Error while migrating from react-native-fcm to react-native-firebase - ios

I am migrating my react native app that used react-native-fcm and react-native-firebase-analytics that are now deprecated to use react-native-firebase.
The build runs fine, however when the app start, it stays on the splash screen for almost a minute (which is weird), then crashes with an error:
TypeError: 'undefined' is not an object (evaluating 'RNFIR.requestPermissions()')
There is no such expression in my code, everything is up to date.
My guess is that it might come from inside the react-native-firebase lib but I'm not sure how to fix it. Any ideas?

Make sure you remove all the libraries installed from react-native-fcm in xcode, I migrated from react-native-fcm to react-native-firebase and there were a few left over libraries that I had to manually remove.

Related

No matching function for call to 'RCTAppSetupPrepareApp'

When running Archive in XCode 14.2 of react native code we run into this error in AppDelegate file.
No matching function for call to 'RCTAppSetupPrepareApp'
I am using react native 0.71.7, react-native-cli: 2.0.1, and node 18.13.0
The code was supposed to be archived, but doesnt.
I was facing same error so I checked the actual version of react and previous I had when it worked last time. According to react-native upgrade helper, I see that this piece of code has changed and is no longer there. Check if this is not the case for you too.
https://react-native-community.github.io/upgrade-helper/?from=0.70.6&to=0.71.2

With cordova-plugin-facebook4#4.2.1 "User cancelled." error thrown immediately after invoking the login method

Facebook login was working fine for both Android and iOS like 2 weeks ago, but for some reason lately on iOS it has been crashing, whenever someone from iOS tries to login it sends out the error of:
"User cancelled"
I tried to fix it by updating the plugin, however the error persists.
I do not think there's something wrong with my code since Android still works and iOS used to work, and I've not changed anything from the login code.
Steps:
Remove plugin
Remove BOTH Android and iOS platforms (cordova platform remove android // cordova platform remove ios)
Reinstall plugin
Verify that it's up to date npm outdated (I think that's the command)
Problem went away, the deal was to FORCE the update on the plugin, which won't happen if any of the platforms is still installed by the time you try to re-install it again.

NativeModules.RNRadar remains undefined after installing native SDK

When running on the iOS emulator any Radar function produces a "NativeModules.RNRadar is undefined" error. I have followed the SDK instructions for iOS. I have not installed for Android.
The app, which is just the basic rn template app, runs fine until I call Radar.
Start clean project using rn typescript template.
Follow SDK installation instructions from Radar docs.
Install RN package and follow installation instructions.
Call Radar from App.tsx in componentDidMount.
Update:
In the Plist screenshot you'll see an empty string for one of the privacy settings. I put in a string and it didn't change anything.
The errors in AppDelegate don't have an effect at runtime.
I was missing the # string prefix in initializeWithPublishableKey but somehow the native code was compiling.
From the accompanying GitHub thread...
Yeah, this is very odd as that native could shouldn't even compile;
the string literal in [Radar initializeWithPublishableKey:"key"]
should fail, should be [Radar initializeWithPublishableKey:#"key"].
I've noticed that react native builds can fail but the toolchain still
pushes an old version of the .app to the simulator, its worth double
checking that your build is succeeding.

react native for ios seems to include a library from a previous project

So I am trying my first few tutorials with react native and therefore am still quite unfamiliar. I had followed this tutorial for using an npm camera in an IOS app. The camera worked find but I had to go an link this library for the camera. I tried it both the manual approach and rnpm. However, now I have a different tutorial on the go which I was messing around with prior to the camera one, and the simulator throws this error.
undefined is not an object (evaluating 'CameraManager.Aspect'), and further down there is also an error about a file which I know was only in my other tutorial(because I wrote it).
So this seems to me like xCode or the node modules for react are somehow still holding this code. I had previously added an entry to the header search paths under the projects build settings, but I looked at it and this path I needed for the camera is not there. So I don't know where this is coming in from.
I ran react-native run-ios on my project, and I tried cleaning the product in xcode and running from there. So far I haven't had very much luck figuring this out.
Ok so this was a simple human error on my behalf. I will post an answer to it anyhow as it might help some react-native beginners. So I had recently made the switch from linux to OSX, and when I started on there linux I had always run the packager for react native manually, and then I found out on OSX I can just run react-native run-ios in the root of the project and it starts another terminal window with the packager running.
The react-native packager was causing the issue. When I ran the react-native run-ios command the following day(didn't turn off my computer) the packager in the other window was forgotten about and I thought it be smart enough to kill that process and restart a new packager for the other project, but it didn't. Hopefully if anyone makes the same assumption you can save some time with this answer.

react-native integrating with existing ios apps

Have followed the instructions from here:
https://facebook.github.io/react-native/docs/embedded-app-ios.html#content
I am able to install required react sub specs and react spec with pod install
I was able to run the local react server to serve the bundles as well.
But I am seeing the following issues which is preventing my app from starting up in the iOS simulator.
/.../node_modules/react-native/React/Executors/RCTContextExecutor.m:560:7: Comparison of function 'JSGlobalContextSetName' not equal to a null pointer is always true
/.../node_modules/react-native/React/Base/RCTRootView.m:230:17: Method override for the designated initializer of the superclass '-initWithFrame:' not found
Can anybody help decyphering whats going on? Seems like it is specific to the RCTRootView implementation inside react library.
i figured the problem was with where i started the react-native app. It was not running from the project root. fixing that fixed the starting of the app in the simulator and these warnings werent the real root cause.

Resources