Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29762

Why GoogleAuthProvider().setCustomParameters in firebase android sdk not exist?

$
0
0

Im curious about why android sdks don't have setCustomParameters. I'm working in a react native app and react in the web and I can handle auth/account-exists-with-different-credential error with firebase web sdk like this

const providers = await this.afAuth.auth.fetchSignInMethodsForEmail(error.email);
const firstPopupProviderMethod =
                            providers.find(p => this.firebaseAuthService.supportedPopupSignInMethods.includes(p));

                        // Test: Could this happen with email link then trying social provider?
                       if (!firstPopupProviderMethod) {
                            throw new Error(`Your account is linked to a provider that isn't supported.`);
                        }

                        const linkedProvider = this.firebaseAuthService.getProvider(firstPopupProviderMethod);
                        linkedProvider.setCustomParameters({ login_hint: error.email });

                        const resultProvider = await this.afAuth.auth.signInWithPopup(linkedProvider);
                        await resultProvider.user.linkWithCredential(error.credential);

I see that IOS sdks got setCustomParameters too but android sdks don't have it. There is something equivalent or just not exist for some reason. I'm reading how to handle the error in this issue https://github.com/invertase/react-native-firebase/issues/2802 but there can be another way to directly linkProvider instead of make user signIn with google again?.


Viewing all articles
Browse latest Browse all 29762


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>