React-native-firebase: firebase.auth(...).getRedirectResult is not a function after setup (with redux)

Created on 21 Sep 2017  路  14Comments  路  Source: invertase/react-native-firebase

Issue

I get the following error firebase.auth(...).getRedirectResult is not a function after following the guide to setup library - I also followed the redux setup guide.

Environment

  1. Application Target Platform: Android

  1. Development Operating System: macOS Sierra

  1. Build Tools: Android SDK 26.0.1

  1. React Native version:
    react-native-cli: 2.0.1
    react-native: 0.48.3

  1. RNFirebase Version: 2.2.0

  1. Firebase Module: All

Most helpful comment

@NathHorrigan Did you provide enableRedirectHandling: false? If you are using the most recent v2.0.0-* pre-release, it shouldn't be necessary.

Since it relates to your usage with react-redux-firebase, lets track solving it in an issue on there so that this closed issue does not keep getting updated.

All 14 comments

@NathHorrigan getRedirectResult is not supported in react-native-firebase as it's not possible to use redirect-based sign in flows in React Native. Assuming you're trying to do Facebook or Google sign in, you'll need to get the credential using a third party library, e.g. react-native-fbsdk or react-native-google-signinthen use the signInWithCredential or linkWithCredential methods that react-native-firebase exposes.

But I'm not calling any auth methods. I have just setup and installed react-native-firebase - nothing else.

What other third party libraries are you using? One of these must be trying to call that method...

Must have been some sort of cached file. The problem resolved itself after I resaved and built some files. Thanks for your help anyhow!

No probs

@chrisbianca Actually the error has reappeared but only when using remote JS debugging 馃槙

Sounds like a weird caching issue to me, or there is something using it in the background.

As an FYI, this has prompted us to make some changes in v3 to make it clear which methods we don't support because the native SDKs don't support them. This is one of them.

This is still happening on all 3 browsers that I have tested (Chrome Canary, Chrome Stable, Firefox Dev edition)

Faced the same issue if I enable Remote JS Debugging.

I didn't call any auth() method at all.

"react-native": "^0.48.3"
"react-native-firebase": "^2.2.2"
"react-redux-firebase": "^2.0.0-beta.8"

I think the issue comes from react-redux-firebase.

@NathHorrigan @hisokakei This looks like it's something internal to react-redux-firebase as per the below:

https://github.com/prescottprue/react-redux-firebase/blob/ed6b902aee8ca225b02e307b71ff1b93b4f9f6fe/src/actions/auth.js#L268

@prescottprue GetRedirectResult isn't supported by the native SDKs - how can these guys work around the issue? It looks like there's a config flag which might be possible to disable?

@chrisbianca If we can know with confidence that it is this type of environment (i.e. an instance of react-native-firebase instead of regular firebase) than we could possibly call whatever interaction react-native-fbsdk needs. I would need to look a little more into it.

The current react-native example for v1.*.* of react-redux-firebase uses react-native-google-signin along with the Firebase JS library to make things work. I'm wondering if we can do something similar internally, but it would be ideal to keep it from adding dependencies for those who are not using react-native.

This issue on react-redux-firebase may be related, though the explanation seems a little different, so maybe not.

Either way, since OAuth with react-native-firebase seems to be an ongoing issue for multiple people, I am going to prioritize it on the v2 roadmap for react-redux-firebase.

So what is the temporary fix for this?? My firebase setup itself is working - I have a working google signin (with firebase) that works when not remote debugging.

@NathHorrigan Did you provide enableRedirectHandling: false? If you are using the most recent v2.0.0-* pre-release, it shouldn't be necessary.

Since it relates to your usage with react-redux-firebase, lets track solving it in an issue on there so that this closed issue does not keep getting updated.

Use enableRedirectHandling=false in reduxFirebaseConfig for reactReduxFirebase function from 'react-redux-firebase'

Was this page helpful?
0 / 5 - 0 ratings