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

React native Xcode project not starting

$
0
0

I have been getting this error recently after upgrading to Xcode 12.5I can't seem to start the react-native Xcode

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lRNFirebaseerror: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lRNFirebase is not an object file (not allowed in a library)


MacOS update raised EXC_BAD_ACCESS (SIGSEGV)

$
0
0

I'm developing an react-native application on M1 Mac.

I recently updated my mac os to beta version Monterey(version 12.0 beta)

After installing the beta version of the mac os i also installed the Xcode(13.0 beta)

Now my app is installed to the iPad simulator but when i open the app, i get the following error.

error log

Can someone help me.

Thanks in advance!

How to crop a video using react native

$
0
0

are there any library for react native to crop videos.by cropping videos I mean showing some part of the video and rejecting other parts like we crop the images.I am not talking about trimming the video because there is a difference between the word trim and crop

How can I record only interval voice of the mobile using react native and turn it to base64 encoded audio file?

$
0
0

I searched for a lot of solutions and npm libraries. but I can't find any library record the internal voice. All packages just record in general like any normal audio recorder using the mic. But I want to detect the internal sound only.supposing that this internal sound comes from

  • Music app ( Spoitfy, Anghami, or Deezer ).
  • Normal music player.
  • Google music.It would be perfect if there is a solution to get any internal sound.

How to track a users Current Location when they swipe outside of the app in React Native and Expo?

$
0
0

There are times in my app where I will need to track a users location. On the off chance they swipe out of the app, I would still need to track their location to give them accurate data. I have set up and properly asked the user for location permission, and I receive it when they accept, but when I swipe out of the Expo app, my server loses my location and I get disconnected.

I am aware that this may be an Expo related issue, but how can I be sure? I am also aware that I will have to update my P-list and specify that we will need to track their location outside of the app, but how do I make sure this will work in my native app?

I am using React Native and Expo Managed Work Flow

App Randomly Crashes both on Expo Go iOS and on TestFlight With EXC_CRASH (SIGABRT)

$
0
0

My Expo app randomly crashes on Expo Go and testFlight. There are no error messages when the app crashes and I have tried adding try/catch and print statements to no luck. Im having a hard time tracking down which part of the code is even failing. Im starting to get some ideas as I comment out parts of the code but still haven't found anything. There are a number of warning statements including Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. but I'm not sure if that has anything to do with the random crashes. Its really hard to reproduce the crashes since they are so random as well.

Here is a sample crash log from AppStore Connect:

Exception Type:  EXC_CRASH (SIGABRT)Exception Codes: 0x0000000000000000, 0x0000000000000000Exception Note:  EXC_CORPSE_NOTIFYTriggered by Thread:  30

And here is the thread that crashes:

Thread 30 name:Thread 30 Crashed:0   libsystem_kernel.dylib          0x00000001d372d414 __pthread_kill + 81   libsystem_pthread.dylib         0x00000001f1288b50 pthread_kill + 272 (pthread.c:1392)2   libsystem_c.dylib               0x00000001aec0bbf4 __abort + 116 (abort.c:147)3   libsystem_c.dylib               0x00000001aec0bb80 abort + 116 (abort.c:118)4   libc++abi.dylib                 0x00000001ba8fccf8 abort_message + 132 (abort_message.cpp:76)5   libc++abi.dylib                 0x00000001ba8ede4c demangling_terminate_handler() + 308 (cxa_default_handlers.cpp:67)6   libobjc.A.dylib                 0x00000001ba7f6f64 _objc_terminate() + 144 (objc-exception.mm:701)7   libc++abi.dylib                 0x00000001ba8fc0e0 std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59)8   libc++abi.dylib                 0x00000001ba8fc06c std::terminate() + 44 (cxa_handlers.cpp:88)9   libdispatch.dylib               0x00000001a53d1dc4 _dispatch_client_callout + 40 (object.m:562)10  libdispatch.dylib               0x00000001a53d910c _dispatch_lane_serial_drain + 580 (inline_internal.h:2548)11  libdispatch.dylib               0x00000001a53d9c5c _dispatch_lane_invoke + 408 (queue.c:3862)12  libdispatch.dylib               0x00000001a53e3d78 _dispatch_workloop_worker_thread + 708 (queue.c:6601)13  libsystem_pthread.dylib         0x00000001f1289814 _pthread_wqthread + 276 (pthread.c:2211)14  libsystem_pthread.dylib         0x00000001f129076c start_wqthread + 8

Running:"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz","expo": "~40.0.0",

Any help and advice on where I could get started on even debugging this would be much much appreciated

How can we bypass salesforce login screen for authentication by custom login screen?

$
0
0

We need authentication functionality without using salesforce login page, we need our own custom page for login​

As facebook provide option for authentication by using their own button or we can also use their function over our custom button

Note: we are using salesforce mobilesdk and application is based on reactnative.

How to pass authentication token into WebView in React Native?

$
0
0

Have a react native application and a website which run on the same backend. When the user logs into the app, the auth token is stored. I have a WebView component which navigates to a page on my website. However when I navigate to that page, the user is prompted to login again in order to access that page. I want to be able to pass in the auth token in the header to authenticate the user and not have them login again.

What I have tried but doesn't work. (storedToken is the auth token)

<WebView  source={{    uri: uri,    headers: { Authorization: storedToken}  }}/>

How can this be done?


Is there any way to hide first options of @react-native-community/picker?

$
0
0
I would like to hide my first options "Please select" 

of picker item when pop up open, there should be show only label itemwhich i want to select not "please select" label, if anyone help please help, Thank You

Warning : Failed child context type: Invalid child context 'virtualizedCell.cellKey' of type 'number' supplied to 'CellRenderer', expected 'string'

$
0
0

I updgraded from react 16.2 -> 16.3-alpha-1 and react-native 0.52->0.54 and I get the warning above in the simulator.

I was unable to run the iOS(React Native) app after updating XCode 12.5

$
0
0

Log :-

INFO : BSG_KSCrash.m (286): -[BSG_KSCrashsendAllReportsWithCompletion:]: Sending 2 crash reports

2021-06-10 16:10:58.484602+0530 App[59224:548597] [connection]nw_proxy_resolver_create_parsed_array [C23 proxy pac] Evaluationerror: NSURLErrorDomain: -1003

2021-06-10 16:10:59.401755+0530 my app[59224:548593] [connection]nw_socket_handle_socket_event [C24.1:1] Socket SO_ERROR [61:Connection refused] 2021-06-10 16:10:59.405516+0530 myapp[59224:548593] [connection] nw_socket_handle_socket_event [C24.2:1]Socket SO_ERROR [61: Connection refused] 2021-06-1016:10:59.407989+0530 my app[59224:548597] [connection]nw_connection_get_connected_socket [C24] Client callednw_connection_get_connected_socket on unconnected nw_connection

2021-06-10 16:10:59.475431+0530 my app[59224:548597] [connection]nw_socket_handle_socket_event [C25.1:1] Socket SO_ERROR [61:Connection refused] 2021-06-10 16:10:59.479723+0530 myapp[59224:548597] [connection] nw_socket_handle_socket_event [C25.2:1]Socket SO_ERROR [61: Connection refused] 2021-06-1016:10:59.482687+0530 my app[59224:548012] [connection]nw_connection_get_connected_socket [C25] Client callednw_connection_get_connected_socket on unconnected nw_connection2021-06-10 16:10:59.483563+0530 my app[59224:548012] TCP Conn0x6000036d04d0 Failed : error 0:61 [61] 2021-06-1016:10:59.775719+0530 my app[59224:548597] Reports sent. 2021-06-1016:10:59.801 [warn][tid:com.facebook.react.JavaScript] Require cycle:App/Utility/Utility.js -> App/Services/ManageToken.js ->App/Utility/Utility.js

Require cycles are allowed, but can result in uninitialized values.Consider refactoring to remove the need for a cycle. 2021-06-1016:10:59.863 [warn][tid:com.facebook.react.JavaScript] Require cycle:node_modules/@babel/types/lib/definitions/index.js ->node_modules/@babel/types/lib/definitions/core.js ->node_modules/@babel/types/lib/validators/is.js ->node_modules/@babel/types/lib/validators/isType.js ->node_modules/@babel/types/lib/definitions/index.js

Require cycles are allowed, but can result in uninitialized values.Consider refactoring to remove the need for a cycle. 2021-06-1016:10:59.865 [warn][tid:com.facebook.react.JavaScript] Require cycle:node_modules/@babel/types/lib/definitions/index.js ->node_modules/@babel/types/lib/definitions/core.js ->node_modules/@babel/types/lib/validators/is.js ->node_modules/@babel/types/lib/validators/isPlaceholderType.js ->node_modules/@babel/types/lib/definitions/index.js

Require cycles are allowed, but can result in uninitialized values.Consider refactoring to remove the need for a cycle. 2021-06-1016:10:59.866 [warn][tid:com.facebook.react.JavaScript] Require cycle:node_modules/@babel/types/lib/definitions/index.js ->node_modules/@babel/types/lib/definitions/core.js ->node_modules/@babel/types/lib/validators/is.js ->node_modules/@babel/types/lib/definitions/index.js

Require cycles are allowed, but can result in uninitialized values.Consider refactoring to remove the need for a cycle. 2021-06-1016:10:59.870 [warn][tid:com.facebook.react.JavaScript] Require cycle:node_modules/@babel/types/lib/definitions/index.js ->node_modules/@babel/types/lib/definitions/core.js ->node_modules/@babel/types/lib/definitions/utils.js ->node_modules/@babel/types/lib/validators/validate.js ->node_modules/@babel/types/lib/definitions/index.js

Require cycles are allowed, but can result in uninitialized values.Consider refactoring to remove the need for a cycle.

2021-06-10 16:11:00.174 [info][tid:com.facebook.react.JavaScript]'BASE_URL', 'https://dev.fisdbs.com/dbs/' INFO : BSG_KSCrashReport.c(1513): void bsg_kscrashreport_writeStandardReport(BSG_KSCrash_Context*const, const char *const): Writing crash report to /Users/e5599459/Library/Developer/CoreSimulator/Devices/9C8DC585-7A54-4448-A919-A7FD114E763E/data/Containers/Data/Application/53C7609D-3B57-4A64-B613-F8854DDAA8AC/Library/Caches/KSCrashReports/myapp/my app-CrashReport-D506C784-6401-4FD0-98D8-4C67DCD0F542.json2021-06-10 16:11:00.956 [info][tid:main][RCTRootView.m:293] Runningapplication fcbMobileBanking ({initialProps = {};rootTag = 21; }) INFO : BSG_KSCrashReport.c (1513): void bsg_kscrashreport_writeStandardReport(BSG_KSCrash_Context *const,const char *const): Writing crash report to/Users/e5599459/Library/Developer/CoreSimulator/Devices/9C8DC585-7A54-4448-A919-A7FD114E763E/data/Containers/Data/Application/53C7609D-3B57-4A64-B613-F8854DDAA8AC/Library/Caches/KSCrashReports/myapp/my app-CrashReport-4B3F6D90-E9B3-489A-9255-6A1AD52FE3B5.json2021-06-10 16:11:01.617 [error][tid:com.facebook.react.JavaScript]Invariant Violation: Native module cannot be null.

2021-06-10 16:11:01.623[fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JSException: Invariant Violation: Native module cannot be null.2021-06-10 16:11:01.670472+0530 my app[59224:548594] [connection]nw_proxy_resolver_create_parsed_array [C27 proxy pac] Evaluationerror: NSURLErrorDomain: -1003 2021-06-10 16:11:01.795[error][tid:com.facebook.react.JavaScript] Invariant Violation: ModuleAppRegistry is not a registered callable module (callingrunApplication) 2021-06-10 16:11:01.798

[fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JSException: Invariant Violation: Module AppRegistry is not a registeredcallable module (calling runApplication) INFO : BSG_KSCrash.m (286):-[BSG_KSCrash sendAllReportsWithCompletion:]: Sending 2 crash reports 2021-06-10 16:11:06.181814+0530 my app[59224:548012] Reports sent.

2021-06-10 16:13:59.170853+0530 my app[59224:551497] Received XPCerror Connection interrupted for message type 3kCFNetworkAgentXPCMessageTypePACQuery 2021-06-10 16:13:59.171189+0530

my app[59224:551497] Received XPC error Connection invalid for messagetype 3 kCFNetworkAgentXPCMessageTypePACQuery

How to use RCTConvert in react

$
0
0

I am new to react and working on react bridging modules. I just want to know that how the RCTConvert is useful and how can use that. I am following this sitelink

Please, anyone helps me to know about this stuff.

React-Native-Firebase: App store not opening when app is not installed on iOS device

$
0
0

Using the React-Native-Firebase Dynamic Links library, I followed the tutorial mentioned here and then I create a Dynamic Link using the following code:

const link = await dynamicLinks().buildLink({  link: "https://myInternalDomainLink.app",  domainUriPrefix: "https://myFirebaseDynamicLink.app",  android: {    packageName: "sample.app"  },  ios: {    bundleId: "sample.app"  },  analytics: {    campaign: "banner",  },});

When the app is installed on the device, clicking on the link opens the app. That's proper. But if the app is not installed, clicking on the Open button in the browser preview does not open the app store, but instead navigates to the link parameter in the code above.

How can I make the dynamic link which is opened in the browser, to open the app in the App Store instead of navigating to my site's URL?

Correlation ID not found error on iOS build on AppCenter

$
0
0

I get the following error when I try to deploy a react-native iOS app on AppCenter

##[error]"{\"message\":\"Not found. Correlation ID: ec546922-3dbd-488e-80fb-15dcc8a51a84\",\"statusCode\":404,\"code\":\"Not Found\"}"

It started happening last week, but I haven't changed any native dependency, so I'm not sure what is this. Also, the android deployment works fine.

Firebase Analytics: Is there any way of getting user per app version?

$
0
0

Firebase dashboard showing active the user per version in percentage.Is there any way to get exact user counts using a particular version?


Rotate image and save in React-Native

$
0
0

I am going to rotate the image in react–native and I would like to get base64 of rotated image.I used several libraries

  1. react-native-image-rotate: It's working well on Android but on iOS I get rct-image-store://1 as url so I tried getting base64 using rn-fetch-blob but it throws error that can't recognize that url.

  2. react-native-image-resizer: I used this but the response is not good in iOS. If I set -90 then rotate -180, if I set -180 then it's rotating as -270.

Please help me on this problem, how can I rotate the image in iOS.

I need to rotate the image as -90, -180, -270, -360(original).

"unrecognized selector sent to instance" when setting a property on react-native

$
0
0

I'm trying to link my Swift view with my React-Native project. I figured out how to display it, but now when I'm trying to set a property, I'm having this error message:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Switch setMessage:]: unrecognized selector sent to instance 0x7f96b270de70'

In my react-native code, I'm doing:

const SwitchNative = requireNativeComponent('Switch', Switch);class Switch extends Component {  render() {    return (<SwitchNative message="message will be" style={this.props.style} />    );  }}

Then doing this in my SwiftBridge:

// SwiftBridge.h#import "RCTView.h"@interface SwitchBridge : RCTView  @property (nonatomic, assign) NSString *message;@end// SwiftBridge.m#import "RCTBridgeModule.h"#import "RCTViewManager.h"#import "SwitchBridge.h"@interface RCT_EXTERN_MODULE(SwitchManager, RCTViewManager)  RCT_EXPORT_VIEW_PROPERTY(message, NSString)@end

Then finally I have this in my Swift class Switch.swift:

...public func setMessage(message: String) {  NSLog("It's working well");}...

Not sure why it can't find my setMessage function.

OneSignal not registering on multiple devices - React Native

$
0
0

Currently I have managed to setup OneSignal properly on Android and iOS. The problem I am encountering however, is that the only devices that are subscribed and showing up in my OneSignal dashboard are the two initial devices. (One which is an emulated Pixel 3 XL and the other which is a real iPhone X) These two devices were setup following the OneSignal React Native documentation here https://documentation.onesignal.com/docs/react-native-sdk-setup

From my understanding, OneSignal automatically subscribes new devices to the dashboard with the OneSignal.init() method or OneSignal.setAppId() method for my case. I am not too sure if I have to have some additional code to support this.

Here is my entry file that works for the 2 initial devices.

index.js (changed app id to the default, to hide my actual one)

React.useEffect(() => {    OneSignal.setAppId('ce8572ae-ff57-4e77-a265-5c91f00ecc4c');    OneSignal.setLogLevel(6, 0);    OneSignal.promptForPushNotificationsWithUserResponse(response => {      console.log(response);    });  }, []);

Thanks for any help!

How to open Privacy setting page in ios using linking in react native ios 14

$
0
0

Thanks in advance

Am using react native Linking for opening Privacy setting screen in iOS devicesAm using iOS 14.

Linking.openURL('App-prefs:root=Privacy')

The above code not working for me. Is there any work around.

How can I make a link in a nested Text element accessible in React Native?

$
0
0

Problem: I am trying to make a link accessible on both Android and iOS using React Native. iOS has a rotor when using VoiceOver that has an option to switch between links on the screen which does not work for the following element:

<Text>Here is some text <Text accessible={true} accessibilityRole="link" onPress={() => Linking.openURL("https://www.google.com")}> Here is a link</Text></Text> 

The same thing happens on Android when using the Links option to search for links on-screen with TalkBack on. In the above code sample, double-tapping in Android does not open the link when TalkBack is on but in iOS double-tapping the sentence with VoiceOver on does open the link.

Things I've Tried: I have tried splitting the Text elements like this:

<View><Text> Here is some text</Text><Text accessible={true} accessibilityRole="link" onPress={() => Linking.openURL("https://www.google.com")}> Here is a link </Text></View>

This does fix the issue on Android with me being able to double-tap the link and it opens the webpage and it will also allow me to flick to it as a link when I have the links option on for TalkBack, but this is not an optimal strategy because it messes with the format of my sentence for sighted users. This also does not add the link item to the iOS rotor. Given that this is an accessibility problem I have not found a lot of resources on how to fix this issue.

Conclusion: I want to be able to click the link while it is in the nested Text element on Android and I want the links control on TalkBack to work. I would also like to add the links option to the rotor on iOS. For those unfamiliar with the iOS accessibility rotor here is a link to information on iOS accessibility rotorHere is a link for the local/global context menu for accessibility on Android. Any advice on this would be greatly appreciated.

Viewing all 16909 articles
Browse latest View live


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