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

xcode12.3 - building for iOS Simulator, but linking in object file built for iOS, file '...' for architecture arm64

$
0
0

building for iOS Simulator, but linking in object file built for iOS, file '/Users/zzw/develop/xiaoming/code61/xiaozhikanfang/ios/Pods/GoogleMobileVision/BarcodeDetector/Frameworks/BarcodeDetector.framework/BarcodeDetector' for architecture arm64

-I tried a lot of solutions, not using Simulator, even running on iOS devices,Please help me on this regards Thanks


FBReactNativeSpec has added 1 script phase : React Native - IOS

$
0
0

When I "pod install" in react native , I get this warning

[!] FBReactNativeSpec has added 1 script phase. Please inspect before executing a build. See https://guides.cocoapods.org/syntax/podspec.html#script_phases for more information.

Due to this script_phase, I'm not able to run the ios from xcode.

It displays this errorCommand PhaseScriptExecution failed with a nonzero exit code

What I have tried:

reinstalled pods

reinstalled node_modules

Versions:

react-native: 0.64.1

There was an error compiling the project on an iOS device using Xcode

React Native / iOS SDK. No matching function for call to 'RCTBridgeModuleNameForClass' after update iOS SDK to 14.5

$
0
0

I have updated the iOS SDK platform to version 14.5. The Xcode version is now 12.5. After updating, I cannot launch the application on my device. And the compiler throws an error:

No matching function for call to 'RCTBridgeModuleNameForClass'

I tried reinstalling the pods but it didn't help. How can fix it? Thanks

enter image description here

Xcode simulator network connection problem

$
0
0

When I build the application successfully using Xcode,The application on the simulator cannot connect to the network "Don't have internet access",Even that the browser inside the simulator can connect and have internet access.

I've triediOS simulator no internet accessiPhone simulator cannot connect to internetAnd nothing seems to work for me.

Any help please?

macOS Big Sur Version 11.2.3

Xcode Version 12.5 (961.1)SimulatorKit 609CoreSimulator 757.5

I'm using React Native v0.64Fetch API response is [Error: Network Error]

Logs

 [javascript] 'ApiClient', 'GET', '/api/v1/explores/image_feed'    [Adjust]w: SANDBOX: Adjust is running in Sandbox mode. Use this setting for testing. Don't forget to set the environment to `production` before publishing    [Adjust]d: Delegate implements adjustDeeplinkResponse:    [Adjust]e: Adjust already initialized    [Adjust]v: Foreground timer is already started    [Adjust]v: Subsession start    [Adjust]v: Started subsession 2 of session 1    [Adjust]d: Wrote Activity state: ec:0 sc:1 ssc:2 ask:0 sl:62.2 ts:59.9 la:1621426622.1 dt:(null) gdprf:0 dtps:0 att:0 [javascript] Default values set. [javascript] 'deeplink handling event', { url: null } 7.11.0 - [Firebase/RemoteConfig][I-RCN000026] RCN Fetch failure. Response http error code: 403 [javascript] [CodePush] App is up to date. [javascript] Possible Unhandled Promise Rejection (id: 2):Error: [remoteConfig/unknown] Internal Error. Status code: 403NativeFirebaseError: [remoteConfig/unknown] Internal Error. Status code: 403 [javascript] 'ApiClient', 'GET', '/api/v1/link_groups' [javascript] 'Be aware that changing the visibility of header in modal on iOS will result in resetting the state of the screen.', '\n    at NativeStackView  screen parameters are unexpected: MGScreenClass1125x2436x3x495 SCREEN_TYPE(1125,2436,3,495) [javascript] 'ApiClient', 'POST', '/api/v1/users/sign_in'    [Adjust]v: Foreground timer fired    [Adjust]d: Wrote Activity state: ec:0 sc:1 ssc:2 ask:0 sl:120.8 ts:118.5 la:1621426680.7 dt:(null) gdprf:0 dtps:0 att:0    [Adjust]v: Foreground timer fired    [Adjust]d: Wrote Activity state: ec:0 sc:1 ssc:2 ask:0 sl:180.8 ts:178.6 la:1621426740.7 dt:(null) gdprf:0 dtps:0 att:0 [connection] nw_socket_handle_socket_event [C24.1:3] Socket SO_ERROR [54: Connection reset by peer] [connection] nw_read_request_report [C24] Receive failed with error "Connection reset by peer"    [Adjust]v: Foreground timer fired    [Adjust]d: Wrote Activity state: ec:0 sc:1 ssc:2 ask:0 sl:240.6 ts:238.3 la:1621426800.5 dt:(null) gdprf:0 dtps:0 att:0

setBackgroundMessageHandler is working on android but not on IOS in react native

$
0
0

Background notifications are received on Android but not on IOS in react native.

index.js

 messaging().setBackgroundMessageHandler(async (message)=>{  console.log(message)});

This is called before registering the component as is mentioned in a certain Github issues.

This problem arises after migrating to react native firebase v6.

Package versions:-

"@react-native-firebase/app": "^11.0.0","@react-native-firebase/messaging": "^11.0.0"

AppDelegate.m

    #import "AppDelegate.h"#import <React/RCTBridge.h>#import <React/RCTBundleURLProvider.h>#import <React/RCTRootView.h>#ifdef FB_SONARKIT_ENABLED#import <FlipperKit/FlipperClient.h>#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>static void InitializeFlipper(UIApplication *application) {  FlipperClient *client = [FlipperClient sharedClient];  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];  [client addPlugin:[FlipperKitReactPlugin new]];  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];  [client start];}#endif#import <GoogleMaps/GoogleMaps.h>#import <Firebase.h>#import <React/RCTLinkingManager.h>@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{  #ifdef FB_SONARKIT_ENABLED  InitializeFlipper(application);  #endif  [GMSServices provideAPIKey:@"AIzaSyA19U0nRV9PKyWHz-252DKVkShrzooWt5Q"];  [FIRApp configure];  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge                                                   moduleName:@"Sociana"                                            initialProperties:nil];  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];  UIViewController *rootViewController = [UIViewController new];  rootViewController.view = rootView;  self.window.rootViewController = rootViewController;  [self.window makeKeyAndVisible];  return YES;} - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *, id> *) options {   return [RCTLinkingManager application:app openURL:url options:options];//return [self.authorizationFlowManagerDelegate resumeExternalUserAgentFlowWithURL:url]; }- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler{ return [RCTLinkingManager application:application                  continueUserActivity:userActivity                    restorationHandler:restorationHandler];}- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo                                                       fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{}- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge{#if DEBUG  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];#else  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];#endif}@end

AppDelegate.h

#import <React/RCTBridgeDelegate.h>#import <UIKit/UIKit.h>#import "RNAppAuthAuthorizationFlowManager.h"@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate,RNAppAuthAuthorizationFlowManager>@property (nonatomic, strong) UIWindow *window;@property(nonatomic, weak)id<RNAppAuthAuthorizationFlowManagerDelegate>authorizationFlowManagerDelegate;@end

The notification payload that I am sending through the REST API is:-

apns: {      payload: {        aps: {"content-available": "true"        }      },      headers: {"apns-priority": "10",      }    }

I have used an external device for testing, enabled all the background modes and push notifications in xcode and also from the apple dev account.Current xcode version is 12.4

Any help will be appreciated. Thank you!

How do you prevent the bottom area in a React Native SafeAreaView from overlapping over the content?

$
0
0

I'm implementing a <SafeAreaView> on my React Native app. Most of my screens are in a ScrollView. When I add the <SafeAreaView>, it obstructs the content. While I want this bottom area to be "safe", I'd like the user to be able to see the content behind it, otherwise, the space is wasted.

How do I implement a "transparent" safe area?

Simplified example:

class ExampleScreen extends Component {  render() {    return (<SafeAreaView><Scrollview><Text>Example</Text><Text>Example</Text><Text>Example</Text>          (etc)</Scrollview></SafeAreaView>    );  }}

Output:

Desired Output:

Firebase Phone Auth does not work with React Native app (screen stays white after reCAPTCHA)

$
0
0

I'm completely stuck with the Firebase/React Native phone auth implementation. I've followed the guidelines and documentation very closely and pretty much copy-pasted the code from this official Firebase/React-Native how-to guide.

The problem I face is the following:

iOSWhen I test the integration with the simulator or with a real device (Product Scheme is set on Debug in Xcode), the authentication method always starts the reCAPTCHA process. The Firebase documentation states, that the reCAPTCHA process is just a fallback, and usually (and mostly) a silent pushnotification in the background does the job of verifying the device. However, I'm always presented the reCAPTCHA process. Furthermore, after I complete the reCAPTCHA job, the WebView goes white and stays there. When I click on "done", the Firebase integration throws a message, that the phone authentication process was cancelled by the user (because I closed the WebView when I click on "done"). If I do not click on "done", the WebView stays white forever.

AndroidWith Android (simulator and real device) I'm at least able to verify my test numbers (which I have configured in the Firebase dashboard) and everything works smoothly. However, when I want to test a real phone number (and I except a real SMS with a code), the Firebase integration throws an error which says the following:

[auth/missing-client-identifier] This request is missing a valid app identifier, meaning that neither SafetyNet checks nor reCAPTCHA checks succeeded. Please try again, or check the logcat for more details.

I have activated the Android Device Verification API on Google Cloud Platform, I have uploaded the correct SHA1 values on Firebase, I have downloaded and integrated the updated google-services.json (for Android) and GoogleService-Info.plist (for iOS), I have created APN certificates at Apple and uploaded those to Firebase and I also added the correct URL Schemes to Xcode (the REVERSED_CLIEND_ID from the GoogleService-Info.plist file).

In the end I just want to verify if users enter a correct phone number. I don't need the authentication part.


react native splash screen programatically

$
0
0

I want to manage splash screen programatically in react native. Is there any way get splash screen image from api or internal storage. Also I want to change app name and app icon programmatically. For example after change picker item change app can be change splash screen, app name and icon.

How to properly unmount all screens on logout using react-native?

$
0
0

I'm building an app using react-native and stack navigators, and tab navigators. Screens never unmounts when navigating. I want to unmount the screens when a user press a 'logout' button, so when a new user logs in all screens need to be mounted again without old state preservation.

How can I do this?Using this.props.navigation.popToTop() inside a screen does not work.

My current navigators structure:

App DrawerNavigator -> OnBoard Drawer Navigator --> (SignIn screen, SignUp screen)                    -> Logged Drawer Navigaror --> Home Tab Navigator                                               --> Settings Stack Navigator -->(Settings screen)

I'm calling the logout function inside the Settings screen.

react-native-image-crop-picker ios gallery closes

$
0
0

For the first time picker opens gallery - all is ok. For the second time and other next times picker opens gallery and closes it right away.If I try use Camera - same result.Problem on device and simulator.

NSCameraUsageDescription, NSPhotoLibraryUsageDescription, NSMicrophoneUsageDescription are added to info.plist.

No any error in xcode, simulator and logs. App doesn't crash.

react-native: 0.62.2react-native-image-crop-picker: 0.35.2

How to get current route name in react-navigation?

$
0
0

I want the name of the current route or screen in react-navigation which I want to use inside if condition to make some changes.

react-native-maps: Google Maps shows blank on iOS

$
0
0

I've followed this guide to install on my react native project and run on iOS simulator but it still shows blank Google Maps (native Apple Map works normally), I tested my API Key and it still works, and I've tried to implement another API key but it still not work also. Anyone could help me on this, I have reasearched all the issue topic but still not possible, thanks in advance.

React Native: 0.64.1iOS: 14.5react-native-maps: 0.28.0

Screenshot here

How can I pass a piece of data to a different instance of the same screen in React Native?

$
0
0

I am a fairly new to RN and stuck trying to create an RTC application using React Native and Agora. I took a sample project found online and tried to tweak it to demo the necessary functionality. But the biggest issue I have is displaying the users in a particular channel. The Agora SDK has no method to obtain it and so user data must be maintained in a separate state. I cannot however pass user data to the host screen once they join the channel. It only appears in the audience screen.

The following snippet of code is how the communication channel is initialized.

const [channelID, setChannelID] = useState('')...const hostCreate = () => navigation.navigate('Live', { type: 'create', channel: uuid() });const joinInProgress = () => navigation.navigate('Live', { type: 'join', channel: joinChannel });

Host uses hostCreate to start up a channel and the id generated is used for others to join with the two separate versions differentiated by the type parameter.What's the best way to pass data when a new join occurs when joinInProgress is called? I tried setting up a redux store and dispatching a new user inside joinInProgress but it shows up empty in host's screen.

The sample app I'm refering to is here.

ld: 1 duplicate symbol for architecture x86_64 + linker command failed with exit code 1

$
0
0

I was involving in some source code integration to a working app. When I build the app I had below issue. As in the logs, It seems the issue is some conflict with react-native-svg: 9.13.3 and react-native-vlc-player: 0.2.0.

This could be a duplicate issue but didn't get any luck searching other related issues.

Does anyone have an idea about this issue?

duplicate symbol '_distance' in:    /Users/Niroshan/Documents/GitHub/MyApp/ios/build/MyApp/Build/Products/Debug-iphonesimulator/RNSVG/libRNSVG.a(RNSVGPathMeasure.o)    /Users/Niroshan/Documents/GitHub/MyApp/ios/Pods/MobileVLCKit/MobileVLCKit.framework/MobileVLCKit(tools.c.o)ld: 1 duplicate symbol for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)** BUILD FAILED **The following build commands failed:        Ld build/MyApp/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp normal x86_64(1 failure)

is there a way to open an app like Facebook in a phone device background, through an 'onPress()' event in my Application?

$
0
0

Basically, I would like to copy some text fields from the User's Facebook app onto my application, which would be displayed on my app. I am familiar with using Selenium WebDrivers to help me web scrape information online and then display it on web applications, but I would like to implement a similar feature through my phone app as well. Any suggestions?

This would mean when a user presses a button on my app, it opens Facebook in the background and copies a text field from the Facebook app, and then display that text field on my app.

React-Native to close native FaceID permission popup

$
0
0

I'm working on an application where I'm using FaceID for iOS app login and it asks for the app permission for the first time, the problem that I'm facing is that I have an app timeout feature enabled where the app logs out automatically if it kept ideal for one minute, so due to which if I don't take any action on the FaceID permission popup and kept it ideal, it will logout from the app, while the popup stays as it is.

I want to close the popup without any action along with logout.

I am not sure to handle it programmatically

I don't want to use any external library

"Error: EMFILE: too many open files" using Xcode to archive React Native App

$
0
0

I know there are a lot of similar questions out there, but my issue seems to be unique, and the solutions suggested aren't solving it:

I'm trying to build an archive of a React Native App from Xcode and, since updating to macOS 11.3.1 and Xcode 12.5, I get "Error: EMFILE: too many open files" when Xcode is trying to run the node bundle command.

I've already installed and updated watchman via homebrew, and have also increased my system's maximum open files and open files per process to unreasonably high values.

Oddly enough, I can do a debug build from Xcode with no issues, and running the node bundle command that Xcode's archive fails on from the command line completes without any issues. I'm able to run and debug the App with no issues, it's just when Xcode is trying to bundle the js for an archive that it seems to fail.

It's almost like Xcode is not using watchman (while the terminal is) and/or it's process has a limit on the number of open files that is different from what I get in the terminal.

Remove link from dynamic link firebase in iOS

$
0
0

In iOS the listener from dynamic link always called and not leave the content the dynamic link in react-native. has how to remove the link from dynamic link firebase react-native.

Styling React Native Picker

$
0
0

I'm attempting to style the text color of the items in a React Native picker. I've only been working in iOS so far, but if I could find a cross-platform solution that'd be awesome.

I've tried the following things:

Styling color on Picker

<Picker style={{color:'white'}} ...etc >

Styling color on Picker Items

<Picker.Item style={{color:'#fff'}} label={'Toronto'} value={'Toronto'} />

I've also seen some examples of adding a color property, so I tried this

<Picker.Item color='white' label={'Toronto'} value={'Toronto'} />

At a total loss here. Thanks for any insight!

EDIT:Here's a solution - use itemStyle prop in the Picker element. I believe this is iOS only.

<Picker itemStyle={{color:'white'}} ><Picker.Item color='white' label={'Toronto'} value={'Toronto'} /><Picker.Item  label={'Calgary'} value={'Calgary'} /></Picker>
Viewing all 16907 articles
Browse latest View live


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