1

React Native Firebase installation for iOS gets held up at the "Run your app to verify installation" screen.

React Native Firebase has worked on Android for me before.

I followed these instructions.

https://rnfirebase.io/docs/v5.x.x/installation/ios https://firebase.google.com/docs/ios/setup#add_the_sdk

Here are what I've done so far.

-Set up a project within Firebase.google.com page.

-Create an iOS app there.

-Install react-native-firebase via npm.

-Add GoogleService-Info.plist file to the project within XCode.

-Make changes to ios/[YOUR APP NAME]/AppDelegate.m file.

-Creat a new Podfile (Cocoa pod) and updated it by "pod update" command.

-Add and edited lines to the Podfile per the instruction.

-Run "pod install"

-Run "react-native link react-native-firebase" from the project root.

-Click "Next" button within Firebase console and move on to "Run your app to verify installation" section.

-Run the iOS app on simulator by running "react-native run-ios" command.

The app boots up and functions as normal in the simulator.

Nothing happens in the Firebase page.

This is the first couple of lines of my Podfile.

# Uncomment the next line to define a global platform for your 
project
platform :ios, '9.0'

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

target 'My_App_Name' do
L.U.
  • 501
  • 5
  • 20
  • In native iOS you need to import the specific Firebase modules in addition to `Firebase/Core`, such as `Firebase/Firestore`, `Firebase/Storage`, etc. – trndjc May 27 '19 at 16:01
  • Ha! Does that mean Firebase authentication won't recognise it if you only have Core? I did not know that! Thanks. I tried with Analytics and AdMob modules this time. But the same result. Still stuck at 'Run your app to verify installation'. – L.U. Jun 04 '19 at 08:28

7 Answers7

1

https://dev-yakuza.github.io/en/react-native/react-native-firebase-admob/

Check this guy's blog. In his particular case, he is integrating Firebase and Admob, but the first part is really descriptive on how to install and set the RNFirebase package.

P.Zdravkov
  • 141
  • 5
  • Thanks. Yes. I had looked at that blog as well with the same result. Some of the documentation they used in this blog contradicted with the official React-Native-Firebase instruction. It might be based on an older version of React-Native-Firebase. I think the best value this blog provides is the steps AFTER you've completed the initial set-up. When I was working on Android app, this blog was the most helpful tutorial around how to display the ads on your App.js level. (After you've installed React-Native-Firebase). Did you actually follow this blog and managed to install Firebase on iOS? – L.U. Jun 15 '19 at 15:33
  • I have been using this tutorial for the projects I have been working on. I am using react-native 0.59.8 , react-native-firebase 5.4.2. I am integrating Firebase for both Android and iOS app. For iOS dealing with the pads is a little troublesome. When you install the firebase pad, make sure you open the xcworkspace file not the xcodeproj. Open it in XCode and make sure it builds fine. If it doesn't trace the error and fix it. A rule I follow when integrating an external library that needs to be linked, is to always run it in Android studio and XCode and build the apps. – P.Zdravkov Jun 17 '19 at 20:09
  • Also, make sure you reinstall the app on the device (real / emulator) and copy the config in the right directory. Else, you can download the example project form the RN Firebase website. Hope this helps. Regards. – P.Zdravkov Jun 17 '19 at 20:15
1

I found the partial answer to this thanks to @Mike Hardy in the other thread here:

Error message - RNFirebase core module was not found natively on iOS

For the most part, you can trust the official instruction on this page.

https://rnfirebase.io/docs/v5.x.x/installation/initial-setup 

However. There are a few things that are not articulated there you’d need to follow in order to install React Native Firebase on iOS. I followed the below steps and I managed to get it through the infinite “Verify installation” loop.

-1) Comment out the following lines from your Podfile. You might see the same line in two locations. Comment out all of them.

use_frameworks!

-2) Also comment out a couple of lines just BEFORE the very last end in your Podfile. Once you’ve done this, you will only see one instance of end at the last line.

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

-3) Insert the following line just before the final end.

system("mkdir -p Pods/Headers/Public/FirebaseCore && cp Pods/FirebaseCore/Firebase/Core/Public/* Pods/Headers/Public/FirebaseCore/")

-4) And then, run pod install and pod update from your terminal.

-5) Go to Xcode, Check the Build Phases/ Link Binary with Libraries section. Confirm that libRNFirebase.a is already there.

-6) Go to Xcode, select a device of your choice and hit “Run”*

*If you use the command from terminal, it will no longer open your app in the simulator. I don’t know why. But it looks as if once React Native Firebase is installed, the only way to test your app is through the Xcode.

react-native run-ios

**Please note I’ve only verified it with the ‘Firebase/Core’ pod. When I tried to add ‘Analytics’ or ‘AdMob’ module in the Podfile, it crashed.

L.U.
  • 501
  • 5
  • 20
1

The problem for me was that my GoogleService-Info.plist was actually from a different firebase project, so it had the wrong project id, bundle id, etc.

Elf
  • 11
  • 1
1

FOR REACT NATIVE

So I had the same problem and silly me I put the GoogleService-Info.plist file in the wrong place...

It needs to go directly in the /ios folder!

Taylor A. Leach
  • 2,115
  • 4
  • 25
  • 43
0

You need to include necessary modules in your Podfile. Here is my Podfile

  pod 'Firebase/Core', '~> 6.3.0'

  pod 'Firebase/Messaging', '~> 6.3.0'

  pod 'Firebase/AdMob', '~> 6.3.0'

Note that I had to manually change framework path of GoogleMobileAds with XCode to value $(SRCROOT)/../../../ios/Pods/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework-Current in RNFirebase.xcodeproj file in Librairie > Build Settings > Framework Search Paths

Porzio Jonathan
  • 536
  • 2
  • 13
  • Thanks! Can you elaborate a little more on that? Did you mean “.xcworkspace” ? Or did you actually mean “.xcodeproj”? How do you locate the section you are referring to? I see there is a “Build Settings” section. But I’m not sure what you are referring to. – L.U. Jul 28 '19 at 16:35
  • In fact there are two .xcodeproj, first one is from your project, then Librairies folder and you will find the second one from RNFirebase. Then we are talking about Build Setting and Framework Search Paths of this last one. – Porzio Jonathan Jul 28 '19 at 17:33
0

I don't know if this works for you but this is what I did. I backed up my files. created a new project. Ran pod init and pod install on a fresh project with no code. After this I closed Xcode and ran $ sudo gem install cocoapods --pre in the same terminal window.

Finally in terminal that I ran pod install and pod update again. At this point I reopened my fresh project and reconnected my files.Worked like a gem.

I fought with this for probably 12 hours on my new Mac Book Pro.

0

You probably do not have the latest version of Firebase in your Pods. Open your Pod file and add this before the "end" statement:

pod 'Firebase/Analytics'

pod 'Firebase/Auth'

pod 'Firebase/Firestore'

Go to Terminal and cd to your root folder of the Xcode project.

Now, type "pod install" and hit enter. This should update your Firebase SDK and build the latest version of Firebase when you build your app.

Note: You should also delete your app on Simulator and re-install it for the changes to take effect.

Ravi B
  • 1,574
  • 2
  • 14
  • 31
Skadoosh
  • 141
  • 1
  • 10