React-native-apple-authentication: undefined is not an object (evaluating '_reactNativeFirebase.default.auth.AppleAuthProvider.credential')

Created on 19 Jan 2020  路  9Comments  路  Source: invertase/react-native-apple-authentication

I went through the initial setup and the docs on-site (https://rnfirebase.io/docs/v5.x.x/auth/social-auth) but getting this error after "RNAppleAuth -> didCompleteWithAuthorization":

undefined is not an object (evaluating '_reactNativeFirebase.default.auth.AppleAuthProvider.credential')

React native: 0.61.1 (edit)
RNFirebase: v5.5.6 (edit)
Xcode: 11.3.1 (edit)
Simulator: iPhone 11 - iOS 13

Can someone please help figure out what's going on?

Most helpful comment

I dunno, this error still sounds like something out of date. Perhaps caches incoherent. Try npx react-native-clean-project clean-project-auto && yarn (or npm) && cd ios && pod install and retry? to make sure you have all the right versions actually running

All 9 comments

Your versions are imprecise and this sounds like a react-native-firebase version out of date but I can't tell. You'll want v5.6.0 to make sure it works.
If not, please provide a minimal reproducible example we can clone from github and we can check it out

Thank you for the exceptionally quick response. I updated my comment with more precise versions. I upgraded to v5.6.0 but had the same issue. I'll work on a minimal reproducible example. Anything else I can check in the meantime?

I dunno, this error still sounds like something out of date. Perhaps caches incoherent. Try npx react-native-clean-project clean-project-auto && yarn (or npm) && cd ios && pod install and retry? to make sure you have all the right versions actually running

You are the man! The cleanup worked. Very grateful, thank you

I have a variation of that command line (using that module but with a couple flags set to alter behavior) in my CI as well, it's gold for always making sure things are what you think they are. Cheers!

I am having the same issue, I am also following the same example on the docs
import firebase from 'firebase';
...
const appleCredential = firebase.auth.AppleAuthProvider.credential(identityToken, nonce);
And I am getting "Cannot read property 'credential' of undefined"

The proposed solution by mike doesn't seem to work for me.

I am using:
react-native: ^0.61.4,
react-native-firebase: ^5.6.0,
iOS: 13.1
Xcode: 11.1

Getting a new native module installed correctly is one of the most frequent problems react-native developers face. It still doesn't mean there is a bug in the module though, unfortunately, it's almost certainly a project-specific problem.

I recommend not just "following the same example", I suggest actually cloning this repo and using the example. It will show it works

Thanks for the fast response, I fixed it.

I was importing 'firebase' instead of 'react-native-firebase'
Also I had to add Firebase/Auth to the podfile

that makes sense! Glad you got it working - good luck with your project

Was this page helpful?
0 / 5 - 0 ratings