Search code examples
firebase-authenticationreact-native-firebase

How to properly include 'Firebase/Auth' pod for iOS or react-native project?


Goal: In a react-native project, I'm using react-native-firebase v5.6 and because im using Firebase's authentication, I need to include "Firebase/Auth" in the pod file so react-native-firebase's bindings can use it.

Problem: Once pod "Firebase/Auth" is added and saved to podfile, and pod install is successfully run, the project build fails when compiling RNFirebaseAuth.m. I haven't added any auth related code, just simply installed the pod and clean&ran build. Sidenote, other react-native-firebase setup/integration has been successful to this point.

Failing Error:

/path/to/project/node_modules/react-native-firebase/ios/RNFirebase/auth/RNFirebaseAuth.m:1184:36: error: no known class method for selector 'credentialWithProviderID:IDToken:rawNonce:'
    credential = [FIROAuthProvider credentialWithProviderID:@"apple.com" IDToken:authToken rawNonce:authTokenSecret];

Have I just missed an installation step or what? How do I fix build?


Solution

  • According to mikehardy on GitHub, react-native-firebase v5.6 has a minor breaking change that enforces the use of firebase pods with at least version 6.13.

    I ran pod update and that was all that was needed to fix the build