Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all 16564 articles
Browse latest View live

Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. Due to RNGestureHandler

$
0
0

Build Failed due to RNGestureHandler.

The following build commands failed:
    CompileC /Users/Documents/ReactProject/ios/build/ReactProject/Build/Intermediates.noindex/RNGestureHandler.build/Debug-iphonesimulator/RNGestureHandler.build/Objects-normal/x86_64/RNGestureHandlerManager.o 

React Native IOS fabric crashlytics how to read and solve bags

$
0
0

I have React-native app with crashlytics from Fabric and i get the error on IOS stage: Fatal Exception: RCTFatalException: Unhandled JS Exception: JSON.stringify cannot serialize cyclic structures. This is the Fabric trace:

Crashed: com.twitter.crashlytics.ios.exception
0  vtb.invest                     0x1049f2730 CLSProcessRecordAllThreads + 376 (CLSProcess.c:376)
1  vtb.invest                     0x1049f2b18 CLSProcessRecordAllThreads + 407 (CLSProcess.c:407)
2  vtb.invest                     0x1049e2838 CLSHandler + 26 (CLSHandler.m:26)
3  vtb.invest                     0x1049f0d50 __CLSExceptionRecord_block_invoke + 199 (CLSException.mm:199)
4  libdispatch.dylib              0x197a96184 _dispatch_client_callout + 16
5  libdispatch.dylib              0x197a79dd8 _dispatch_lane_barrier_sync_invoke_and_complete + 56
6  vtb.invest                     0x1049f07f8 CLSExceptionRecord + 206 (CLSException.mm:206)
7  vtb.invest                     0x1049f062c CLSExceptionRecordNSException + 102 (CLSException.mm:102)
8  vtb.invest                     0x1049f0250 CLSTerminateHandler() + 259 (CLSException.mm:259)
9  vtb.invest                     0x104764bc0 CPPExceptionTerminate() + 392
10 libc++abi.dylib                0x197b96304 std::__terminate(void (*)()) + 16
11 libc++abi.dylib                0x197b9629c std::terminate() + 44
12 libobjc.A.dylib                0x197af12dc _objc_terminate() + 10
13 libdispatch.dylib              0x197a96198 _dispatch_client_callout + 36
14 libdispatch.dylib              0x197a7373c _dispatch_lane_serial_drain$VARIANT$armv81 + 564
15 libdispatch.dylib              0x197a74154 _dispatch_lane_invoke$VARIANT$armv81 + 400
16 libdispatch.dylib              0x197a7d43c _dispatch_workloop_worker_thread + 576
17 libsystem_pthread.dylib        0x197ae5fa4 _pthread_wqthread + 276
18 libsystem_pthread.dylib        0x197ae8ae0 start_wqthread + 8

And the issue details comes from this file RCTAssert.m line 163 with RCTFormatError, from this method:

NSString *RCTFormatError(NSString *message, NSArray<NSDictionary<NSString *, id> *> *stackTrace, NSUInteger maxMessageLength)
{
  if (maxMessageLength > 0 && message.length > maxMessageLength) {
    message = [[message substringToIndex:maxMessageLength] stringByAppendingString:@"..."];
  }

  NSMutableString *prettyStack = [NSMutableString string];
  if (stackTrace) {
    [prettyStack appendString:@", stack:\n"];

    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\\b((?:seg-\\d+(?:_\\d+)?|\\d+)\\.js)"
                                                                           options:NSRegularExpressionCaseInsensitive
                                                                             error:NULL];
    for (NSDictionary<NSString *, id> *frame in stackTrace) {
      NSString *fileName = [frame[@"file"] lastPathComponent];
      NSTextCheckingResult *match = fileName != nil ? [regex firstMatchInString:fileName options:0 range:NSMakeRange(0, fileName.length)] : nil;
      if (match) {
        fileName = [NSString stringWithFormat:@"%@:", [fileName substringWithRange:match.range]];
      } else {
        fileName = @"";
      }

      [prettyStack appendFormat:@"%@@%@%@:%@\n", frame[@"methodName"], fileName, frame[@"lineNumber"], frame[@"column"]];
    }
  }

  return [NSString stringWithFormat:@"%@%@", message, prettyStack];
}

Please can somebody explain me how can i read this stacktrace and solve my error.

React Native - is there a library for sign in with Apple ID?

$
0
0

Looking for a react-native library to login with AppleID

How would you implement pinch-zoom in react-native?

$
0
0

I've been looking into PanResponder. My current working hypothesis is that I would detect if there are two touches that are moving outwards and if so, increase the element size in the onPanResponderMove function.

This seems like a messy way to do it. Is there a smoother way?

Can you suggest me few options to do deep linking for react native app? [closed]

$
0
0

I have to do deep linking implementation for my react native application. Suggest good options which work for both android and ios.

How to add 'greact-acr-cloud', a third party library in Xcode? (React-native project)

$
0
0

Hello I have added this dependency to my project using npm, 'npm i greact-acr-cloud'.

This dependency is supposed to use the device's microphone to capture sound. I have a button that triggers the function to execute this, but this only works on android at the moment.

...
import greactAcrCloud from "greact-acr-cloud";

const getSong = props => {
    greactStart = () => {
        greactAcrCloud.start()
          .then((response) => {

            props = response
            console.log(response);
            console.log(props.metadata.music);
          });
        }
   return (
      <Button onPress={() => greactStart()}>
        ....
  )

}

However, with iOS, I am not sure if I am adding it correctly to the project. Here is what my library looks like in xcode. Xcode library of Greact-acr-cloud I've tried going into the ios folder of the project and entering 'pod install' within the terminal, but I receive this.

[!] use_native_modules! skipped the react-native dependency 'greact-acr-cloud'. No podspec file was found.
- Check to see if there is an updated version that contains the necessary podspec file
- Contact the library maintainers or send them a PR to add a podspec. The
react-native-webview podspec is a good example of a package.json driven podspec. See
https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec
- If necessary, you can disable autolinking for the dependency and link it manually. See
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library

I also added the Privacy - Microphone Usage Description key within the info.plist file enter image description here

Where could I be going wrong? Even when running the app, it never asks for permission to use the microphone.

As of now if I remove the Greact-acr-cloud.xcodeproj from the library, the app will build, but the function will not work of course. After pressing the button I get a warning stating something like.

Possible Unhandled Promise Rejection (id: 3): TypeError: null is not an object (evaluating 'GreactAcrCloud.start')

This could be because the microphone isn't catching any sound therefore null is being returned...? Any idea where I am going wrong on ios? It works perfect on Android and gives me the results I need. Please help...

How to create LaunchScreen with a fullscreen Image for IOS in React Native which is screen compatible with iPad and all iPhones

$
0
0

I need a full screen image on my splash screen for IOS App build using react native. I have reffered different post but most of them explains spash screen with a logo at the center and none of them give a proper explanation of full screen splah image which fits all the device resolutions including iPad.

I have created a LaunchScreen.xib file with a View and Imageview as given below but it breaks in iPads, But it fits in iPhones to some extend (Though it has some black shade for high resolution iphones also)

<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15400" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
    <device id="retina5_5" orientation="portrait" appearance="light"/>
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15404"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <view contentMode="scaleAspectFit" id="iN0-l3-epB">
            <rect key="frame" x="0.0" y="0.0" width="414" height="716"/>
            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
            <subviews>
                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Default" id="IGQ-OV-TUd">
                    <rect key="frame" x="0.0" y="-10" width="414" height="736"/>
                    <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
                </imageView>
            </subviews>
            <color key="backgroundColor" red="0.30980392156862746" green="0.42745098039215684" blue="0.47843137254901957" alpha="1" colorSpace="calibratedRGB"/>
            <nil key="simulatedStatusBarMetrics"/>
            <modalPageSheetSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
            <point key="canvasLocation" x="-20.289855072463769" y="107.60869565217392"/>
        </view>
    </objects>
    <resources>
        <image name="Default" width="682.66668701171875" height="910.66668701171875"/>
    </resources>
</document>

I am attaching the settings screenshots of my View and ImageView below

enter image description here

enter image description here

I have created 3 dummy images for three different scales whose Content.json is given below

{
  "images" : [
    {
      "idiom" : "universal",
      "filename" : "Dummy.png",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "filename" : "Dummy@2x.png",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "filename" : "Dummy@3x.png",
      "scale" : "3x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}

All the above changes did'nt give a proper solution for my requirement. I am wondering if I need to create full screen images for all possible devices and include them in the Content.json file. But what width and height should I give in the settings(Scrrenshots)

Sombody please held me to provide the correct solution for my requirement.

Detox - The request was denied by service delegate (PBProcessManager) for reason: Security

$
0
0

Trying to upgrade from Detox 7.3.4 to 8.1.1

It appears to be loading from an apple tv instead of the phone I provide even when providing --configuration

package.json:

"detox": {
    "configurations": {
      "ios.sim.debug": {
        "binaryPath": "member/ios/build/Build/Products/Debug-iphonesimulator/MyApp.app",
        "build": "xcodebuild -workspace member/ios/MyApp.xcworkspace -scheme MyApp -configuration Debug  -sdk iphonesimulator -derivedDataPath member/ios/build",
        "type": "ios.simulator",
        "name": "iPhone 8"
      }
    }
  },

etai$ npm run detox

app@0.0.1 detox /Users/etai/Code/data/mobile NODE_PATH=. detox test -- --artifacts-location='e2e/screenshots' --record-logs all

node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration ios.sim.debug --grep :android: --invert --record-logs all --artifacts-location "e2e/screenshots/ios.sim.debug.2018-07-30 12-55-09Z"

detox INFO: [DetoxServer.js] server listening on localhost:49455...

detox ERROR: [exec.js/EXEC_FAIL, #6] "/usr/bin/xcrun simctl io 368E25FE-3641-48F6-A47C-EA403E68EB85 screenshot "/dev/null"" failed with code = 2, stdout and stderr:

detox ERROR: [exec.js/EXEC_FAIL, #6]

detox ERROR: [exec.js/EXEC_FAIL, #6] An error was encountered processing the command (domain=SimulatorKit.SimDisplayScreenshotWriter.ScreenshotError, code=2):

Error creating the image

detox ERROR: [exec.js/EXEC_FAIL, #10] "/bin/cat /dev/null

/Users/etai/Library/Developer/CoreSimulator/Devices/368E25FE-3641-48F6-A47C-EA403E68EB85/data/tmp/detox.last_launch_app_log.out 2>/Users/etai/Library/Developer/CoreSimulator/Devices/368E25FE-3641-48F6-A47C-EA403E68EB85/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/etai/Library/Detox/ios/d01d632fc9620831ab762e463575a0528084a3af/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 368E25FE-3641-48F6-A47C-EA403E68EB85 com.myapp.MyAppDebug --args -detoxServer ws://localhost:49455 -detoxSessionId 7a268b8c-8ece-f34d-a5d3-13ed361a4b57" failed with code = 1, stdout and stderr:

detox ERROR: [exec.js/EXEC_FAIL, #10] com.myapp.MyAppDebug: -1

detox ERROR: [exec.js/EXEC_FAIL, #10] An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1): The request to open "com.myapp.MyAppDebug" failed. The request was denied by service delegate (PBProcessManager) for reason: Security ("PBD] Denying open-application request for reason: Security (App 'com.myapp.MyAppDebug' looks unsafe for use on the internet; "). Underlying error (domain=FBSOpenApplicationErrorDomain, code=3): The operation couldn’t be completed. [PBD] Denying open-application request for reason: Security (App 'com.myapp.MyAppDebug' looks unsafe for use on the internet; ) [PBD] Denying open-application request for reason: Security (App 'com.myapp.MyAppDebug' looks unsafe for use on the internet; )

  1. Things I have tried:
    • Restarting my computer (v10.13.6) / xcode (v9.4.1) / etc.
    • Using different signing certificates
    • Using different simulators
    • --configuration flag

Full log with --loglevel trace

detox INFO:  [DetoxServer.js] server listening on localhost:49586...
detox DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:49586
detox TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"67bd086e-af49-fd61-1de8-242636d659fe","role":"tester"},"messageId":0}
detox DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=67bd086e-af49-fd61-1de8-242636d659fe
detox DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=67bd086e-af49-fd61-1de8-242636d659fe
detox TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"67bd086e-af49-fd61-1de8-242636d659fe","role":"tester"},"messageId":0}

detox DEBUG: [exec.js/EXEC_CMD, #0] /usr/bin/xcrun simctl list -j
detox TRACE: [exec.js/EXEC_SUCCESS, #0] {
  "devicetypes" : [...,
  {
    "state" : "Shutdown",
    "availability" : "(available)",
    "name" : "iPhone 8",
    "udid" : "87D92BC6-686E-4EB3-9F09-E8865A0BE0ED"
  }, ...],
  "runtimes" : [...,     {
  "buildversion" : "15F79",
  "availability" : "(available)",
  "name" : "iOS 11.4",
  "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-4",
  "version" : "11.4"
}, ...],
detox DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byType "iPhone 8" --byOS "11.4"
detox DEBUG: [exec.js/EXEC_TRY, #1] Searching for device matching iPhone 8...
detox TRACE: [exec.js/EXEC_SUCCESS, #1] [...]
    detox TRACE: [exec.js/EXEC_SUCCESS, #2] Unknown command line option --byId, try --help!

detox DEBUG: [exec.js/EXEC_CMD, #3] xcodebuild -version
detox TRACE: [exec.js/EXEC_SUCCESS, #3] Xcode 9.4.1
Build version 9F2000

detox DEBUG: [exec.js/EXEC_CMD, #4] /usr/bin/xcrun simctl boot 368E25FE-3641-48F6-A47C-EA403E68EB85
detox DEBUG: [exec.js/EXEC_TRY, #4] Booting device 368E25FE-3641-48F6-A47C-EA403E68EB85
detox TRACE: [exec.js/EXEC_SUCCESS, #4] 
detox DEBUG: [exec.js/EXEC_CMD, #5] /usr/bin/xcrun simctl bootstatus 368E25FE-3641-48F6-A47C-EA403E68EB85
detox TRACE: [exec.js/EXEC_SUCCESS, #5] Monitoring boot status for Apple TV (368E25FE-3641-48F6-A47C-EA403E68EB85).
[2018-07-30 13:14:38 +0000] Status=3, isTerminal=YES, Elapsed=00:02.
    Data Migration Failed


detox DEBUG: [exec.js/EXEC_CMD, #6] /usr/bin/xcrun simctl io 368E25FE-3641-48F6-A47C-EA403E68EB85 screenshot "/dev/null"
detox ERROR: [exec.js/EXEC_FAIL, #6] "/usr/bin/xcrun simctl io 368E25FE-3641-48F6-A47C-EA403E68EB85 screenshot "/dev/null"" failed with code = 2, stdout and stderr:

detox ERROR: [exec.js/EXEC_FAIL, #6] 
detox ERROR: [exec.js/EXEC_FAIL, #6] An error was encountered processing the command (domain=SimulatorKit.SimDisplayScreenshotWriter.ScreenshotError, code=2):
Error creating the image

detox DEBUG: [exec.js/EXEC_CMD, #7] /usr/bin/xcrun simctl uninstall 368E25FE-3641-48F6-A47C-EA403E68EB85 com.myapp.MyAppDebug
detox DEBUG: [exec.js/EXEC_TRY, #7] Uninstalling com.myapp.MyAppDebug...
detox TRACE: [exec.js/EXEC_SUCCESS, #7] 
detox DEBUG: [exec.js/EXEC_SUCCESS, #7] com.myapp.MyAppDebug uninstalled
detox DEBUG: [exec.js/EXEC_CMD, #8] /usr/bin/xcrun simctl install 368E25FE-3641-48F6-A47C-EA403E68EB85 "/Users/etai/Code/data/mobile/member/ios/build/Build/Products/Debug-iphonesimulator/ApparMember.app"
detox DEBUG: [exec.js/EXEC_TRY, #8] Installing /Users/etai/Code/data/mobile/member/ios/build/Build/Products/Debug-iphonesimulator/ApparMember.app...
detox TRACE: [exec.js/EXEC_SUCCESS, #8] 
detox DEBUG: [exec.js/EXEC_SUCCESS, #8] /Users/etai/Code/data/mobile/member/ios/build/Build/Products/Debug-iphonesimulator/ApparMember.app installed
detox DEBUG: [exec.js/EXEC_CMD, #9] /usr/bin/xcrun simctl terminate 368E25FE-3641-48F6-A47C-EA403E68EB85 com.myapp.MyAppDebug
detox DEBUG: [exec.js/EXEC_TRY, #9] Terminating com.myapp.MyAppDebug...
detox TRACE: [exec.js/EXEC_SUCCESS, #9] 
detox DEBUG: [exec.js/EXEC_SUCCESS, #9] com.myapp.MyAppDebug terminated
detox TRACE: [ArtifactsManager.js/LIFECYCLE] onBeforeLaunchApp { deviceId: '368E25FE-3641-48F6-A47C-EA403E68EB85',
  bundleId: 'com.myapp.MyAppDebug' }
detox DEBUG: [exec.js/EXEC_CMD, #10] /bin/cat /dev/null >/Users/etai/Library/Developer/CoreSimulator/Devices/368E25FE-3641-48F6-A47C-EA403E68EB85/data/tmp/detox.last_launch_app_log.out 2>/Users/etai/Library/Developer/CoreSimulator/Devices/368E25FE-3641-48F6-A47C-EA403E68EB85/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/etai/Library/Detox/ios/d01d632fc9620831ab762e463575a0528084a3af/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 368E25FE-3641-48F6-A47C-EA403E68EB85 com.myapp.MyAppDebug --args -detoxServer ws://localhost:49586 -detoxSessionId 67bd086e-af49-fd61-1de8-242636d659fe
detox DEBUG: [exec.js/EXEC_TRY, #10] Launching com.myapp.MyAppDebug...
detox ERROR: [exec.js/EXEC_FAIL, #10] "/bin/cat /dev/null >/Users/etai/Library/Developer/CoreSimulator/Devices/368E25FE-3641-48F6-A47C-EA403E68EB85/data/tmp/detox.last_launch_app_log.out 2>/Users/etai/Library/Developer/CoreSimulator/Devices/368E25FE-3641-48F6-A47C-EA403E68EB85/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/etai/Library/Detox/ios/d01d632fc9620831ab762e463575a0528084a3af/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 368E25FE-3641-48F6-A47C-EA403E68EB85 com.myapp.MyAppDebug --args -detoxServer ws://localhost:49586 -detoxSessionId 67bd086e-af49-fd61-1de8-242636d659fe" failed with code = 1, stdout and stderr:

detox ERROR: [exec.js/EXEC_FAIL, #10] com.myapp.MyAppDebug: -1

detox ERROR: [exec.js/EXEC_FAIL, #10] An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):
The request to open "com.myapp.MyAppDebug" failed.
The request was denied by service delegate (PBProcessManager) for reason: Security ("PBD] Denying open-application request for reason: Security (App 'com.myapp.MyAppDebug' looks unsafe for use on the internet; <PBApplicationInfo: 0x7fc86e00b1b0; com.myapp.MyAppDebug (App-Debug); sdk: 11.4>").
Underlying error (domain=FBSOpenApplicationErrorDomain, code=3):
    The operation couldn’t be completed. [PBD] Denying open-application request for reason: Security (App 'com.myapp.MyAppDebug' looks unsafe for use on the internet; <PBApplicationInfo: 0x7fc86e00b1b0; com.myapp.MyAppDebug (App-Debug); sdk: 11.4>)
    [PBD] Denying open-application request for reason: Security (App 'com.myapp.MyAppDebug' looks unsafe for use on the internet; <PBApplicationInfo: 0x7fc86e00b1b0; com.myapp.MyAppDebug (App-Debug); sdk: 11.4>)

detox TRACE: [ArtifactsManager.js/LIFECYCLE] onAfterAll
detox DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=67bd086e-af49-fd61-1de8-242636d659fe

React Native app restarts while on background

$
0
0

I updated my react native app to RN 0.61.2 from RN 0.59 few weeks ago, and a while after that, reading that thread: https://github.com/facebook/react-native/issues/26696 made me upgrade to 0.61.5.

Ever since the first update (to 0.61.2), my app keep restarting while on background .

I have a background location tracking, that is working well, and I can see log in app of location calls going through. But then without no crash report (sentry), and while app is still in background, the app goes back to splash screen.

This happens when there is no internet connection, but not on the first call. only after about 10 calls of location updates to server the app restarts.

So far I tested it only on iOS, but it might also happen on Android devices.

Have been fighting with this for weeks...

Need help desperately

Would appreciate any advice

Implementing ssl pinning in a react-native application using TrustKit iOS

$
0
0

I'm trying to implement SSL pinning in a react-native application (RN 0.60) and I'm using Trustkit.

Following the guide posted in https://github.com/datatheorem/TrustKit these are the step that I've done:

1) Install TrustKit pod using pod 'TrustKit' and pod install

2) Added to my AppDelegate.m this piece of code:

#import <TrustKit/TrustKit.h>

//inside didFinishLaunchingWithOptions

NSDictionary *trustKitConfig =
  @{
    kTSKSwizzleNetworkDelegates: @YES,
    kTSKPinnedDomains: @{
        @"www.datatheorem.com" : @{
            kTSKEnforcePinning:@YES,
            kTSKIncludeSubdomains:@YES,
            //Using wrong hashes so it fails
            kTSKPublicKeyHashes : @[
                @"Ca5gV6n7OVx4AxtEaIk8NI9qyKBTtKJjwqullb/v9hh=",
                @"YLh1dUR9y6Kja30RrAn7JKnbQG/uEtLMkBgFF2Fuihh="
                ]
            }}};

  [TrustKit initSharedInstanceWithConfiguration:trustKitConfig];

When i try to do

 RNFetchBlob.fetch('GET', "https://www.datatheorem.com", {})    //tried using standard fetch() but gives same results
    .then(async(res) => {
        console.log('RES => ' ,res)
    })
    // Something went wrong:
    .catch((err) => {
        console.log('ERROR =>', err);
    })

It goes inside then and doesn't give any error but responds with a 200 status code (using wrong Hashes).

Otherwise, using Android it works correctly, going inside the catch and saying:

Error: Pin verification failed

How to restrict the Visibility of RCTAsyncLocalStorage_V1 folder in IOS while accessing downloaded files in React Native?

$
0
0

It happens while I allow user to see Documents Directory to access Downloaded files.

Unexpected reserved type number [closed]

$
0
0

I have problems using the library

react-native-wheel-picker.

Is there any way to fix it

Thanks

error image

What is the best approach to take if planning to have single code base for mobile Development(iOS and android)? [closed]

$
0
0

In our company we are planning a single code base for our iOS and Android mobile application that currently have a separate code base .The application which is on App Store have features like:-

  • QR code scanner.
  • Connecting bluetooth device.
  • Gathering data form bluetooth device.
  • Showing charts.

I have knowledge about native development and worked on it for developing iOS apps but I don't have in-depth knowledge about the new platforms available like ionic, angular, or react native. Which would be the best approach to take considering all the above features mentioned. What would be best if i need to have single code base and use cross platform tools ? Also which tool or frame work is the best suited for my requirement ? I have gone through angular and ionic but it seems to have issues accessing camera. Any help would be appreciated

No podspec found for `React-Core` in `../node_modules/react-native/React`

$
0
0

I'm using React Native. I get this issue when I try to upload pods. I've successfully installed node_modules, but I'm getting this problem. What is the problem? If we delete the package-lock.json and node_modules folder, I reinstalled npm. But I'm having this problem when I'm doing pod install.

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target '...' do

  # use_frameworks!

  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../node_modules/react-native/React'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  # Required by RNFirebase
  pod 'Firebase/Core', '~> 6.8.1'

  # [OPTIONAL PODS] - comment out pods for firebase products you won't be using.
  # pod 'Firebase/AdMob', '~> 6.8.1'
  pod 'Firebase/Auth', '~> 6.8.1'
  pod 'Firebase/Database', '~> 6.8.1'
  pod 'Firebase/Functions', '~> 6.8.1'
  pod 'Firebase/DynamicLinks', '~> 6.8.1'
  pod 'Firebase/Firestore', '~> 6.8.1'
  pod 'Firebase/Messaging', '~> 6.8.1'
  pod 'Firebase/RemoteConfig', '~> 6.8.1'
  pod 'Firebase/Storage', '~> 6.8.1'
  pod 'Firebase/Performance', '~> 6.8.1'
  pod 'Fabric', '~> 1.10.2'
  pod 'Crashlytics', '~> 3.14.0'


  target '..' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!

end

target '...-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for ..-tvOS

  target 'DeliveryApp-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

library not found for -lRCTOrientation

$
0
0

I'm very beginner in React Native, I build a mobile application which is working OK an android, but when I tried to generate the IPA for iOS using Xcode, I faced this issue

ld: library not found for -lRCTOrientation
clang: error: linker command failed with exit code 1 (use -v to see invocation).

RCTOrientation is shown in red color and i can't find this package in my project folder

enter image description here


Could not find iPhone X simulator. Run CLI with --verbose flag for more details

$
0
0

I downloaded the recently released Xcode 11 beta version, and now I can't run my React-Native app on my simulator. I know there are some question on stack-overflow about this but they did'nt help. the problem is there is no

/node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js

file at all. in the local-cli folder there is only one file named cli.js

'use strict';

var cli = require('@react-native-community/cli');

if (require.main === module) {
  cli.run();
}

module.exports = cli;

React Native two drawers on one screen

$
0
0

I have an app that needs to be able to use two drawer navigators, one on the left and on on the right side of the header.

I am at the point where I can get both drawers to open with the slide gesture, however I need to be able to open it programmatically. I have found the navigation.openDrawer() function only works with one of the drawers and not the other because it is only able to use one of the navigation props (whichever comes first) from my drawer navigators.

Below are my rendering functions:

const LeftStack = createStackNavigator(
  {
    LeftDrawerStack
  },
  {
    navigationOptions: ({navigation}) => ({
      headerLeft: (<TouchableOpacity onPress={() => navigation.openDrawer()}><Icon style={{marginLeft: 10}} name='menu'/></TouchableOpacity>
      )
    })
  }
);

const RightStack = createStackNavigator(
  {
    RightDrawerStack
  },
  {
    navigationOptions: ({navigation}) => ({
      headerRight: (<TouchableOpacity onPress={() => navigation.openDrawer()}><Icon style={{marginRight: 10}} name='ios-bulb'/></TouchableOpacity>
      )
    })
  }
);

export const RouteStack = createStackNavigator(
  {
    screen: LoginScreen,
    navigationOptions: ({navigation}) => ({
      header: null
    }),
    LeftStack,
    RightStack
  }
);

and here are my drawer routes:

export const LeftDrawerStack = createDrawerNavigator(
  {
    Dashboard: {
      screen: DashboardScreen
    },
    History: {
      screen: HistoryScreen
    },
    Privacy: {
      screen: PrivacyPolicyScreen
    },
    TermsAndConditions: {
      screen: TermsAndConditionsScreen
    }
  }, {
    initialRouteName: 'Dashboard',
    contentComponent: LeftDrawerScreen
  }
);

export const RightDrawerStack = createDrawerNavigator(
  {
    LeftDrawerStack,
    Settings: {
      screen: SettingsScreen
    }
  }, {
    drawerPosition: 'right',
    contentComponent: RightDrawerScreen
  }
);

Here is a picture of what I have the navigation looking like so far, however both of the hamburger menus are opening up the same menu on the right instead of one menu on their respective sides.

layout picture

I may be missing some parts but I will be sure to post more info if I forgot any!

Detox: iOS Simulator how to confirm alert message

$
0
0

I am using Alert from react-native.

How do I get detox to press the "Log out" button on the alert message?

enter image description here

I tried using await element(by.text('Log out')).tap();

But I get "Multiple elements were matched" error. Presumably it finds 3 elements with same label. The original button with label "Log out" used to trigger the alert message, the alert message title, and the alert message button I want detox to press.

Error Trace: [
  {
    "Description" : "Multiple elements were matched: (
    "<UILabel:0x7fe7964db910; AX=Y; AX.label='Log out'; AX.frame={{41, 234}, {238, 20.5}}; AX.activationPoint={160, 244.25}; AX.traits='UIAccessibilityTraitStaticText'; AX.focused='N'; frame={{16, 20}, {238, 20.5}}; opaque; alpha=1; UIE=N; text='Log out'>",
    "<UILabel:0x7fe7964dda90; AX=Y; AX.label='Log out'; AX.frame={{198.5, 322.5}, {58, 20.5}}; AX.activationPoint={227.5, 332.75}; AX.traits='UIAccessibilityTraitStaticText'; AX.focused='N'; frame={{0, 12}, {58, 20.5}}; opaque; alpha=1; UIE=N; text='Log out'>",
    "<RCTText:0x7fe79652f300; AX=Y; AX.label='Log out'; AX.frame={{16, 338.5}, {288, 17}}; AX.activationPoint={160, 347}; AX.traits='UIAccessibilityTraitStaticText'; AX.focused='N'; frame={{0, 0}, {288, 17}}; alpha=1>"
). Please use selection matchers to narrow the selection down to single element.",
    "Error Domain" : "com.google.earlgrey.ElementInteractionErrorDomain",
    "Error Code" : "5",
    "File Name" : "GREYElementInteraction.m",
    "Function Name" : "-[GREYElementInteraction grey_errorForMultipleMatchingElements:withMatchedElementsIndexOutOfBounds:]",
    "Line" : "956"
  }
]

I guess one way is to use .atIndex(), but that means I need to play with indexes every time something changes to determine the correct element.

Is there no better way to address this issue?

Thanks.

Issue after react native expo eject: No visible @interface for 'RCTAsyncLocalStorage' declares the selector 'initWithStorageDirectory:'

$
0
0

I just ejected from expo and everything went well but I'm now getting the following error when trying to run my ios app in Xcode :

No visible @interface for 'RCTAsyncLocalStorage' declares the selector 'initWithStorageDirectory:'

Here is part of my package.json

"dependencies": {
"axios": "^0.17.1",
"expo": "^23.0.6",
"lodash": "^4.17.4",
"moment": "^2.20.1",
"react": "16.0.0",
"react-native": "0.50.3",
"react-native-cloudinary": "^1.0.1",
"react-native-communications": "^2.2.1",
"react-native-elements": "^0.18.5",
"react-native-fetch-blob": "^0.10.8",
"react-native-gifted-chat": "^0.3.0",
"react-native-image-picker": "^0.26.7",
"react-native-image-to-base64": "^0.1.0",
"react-native-modal-datetime-picker": "^4.13.0",
"react-native-router-flux": "^4.0.0-beta.24",
"react-navigation": "^1.0.0-beta.22",
"redux-thunk": "^2.2.0"
}

React Native iOS app different code on simulator vs ad hoc/App Store

$
0
0

I have been working on a React Native app for several weeks. I recently pushed a version to TestFlight. When I started getting feedback from users I noticed that their screenshots were different than the latest changes I made. They were from older revisions.

I ran the app in the iOS Simulator. I get the correct version of the code.

I ran the app on a device connected to my Mac. I get the correct version of the code.

I ran the app distributed ad hoc and I get an older version of the app.

I haven't seen anything like this before and baffled as to what could cause the problem.

Viewing all 16564 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>