I was rewriting my code from firebase v8 to v9, i was watching this tutorial
i try to use the signInWithRedirect()
function followed by the getRedirectResult()
function
i import them like i import my others functions but when i console.log()
thoses i get undefined
in my console
here is my code:
import { View } from "react-native";
import firebase, { initializeApp } from 'firebase/app';
import { GoogleAuthProvider, useDeviceLanguage, signInWithCredential, onAuthStateChanged, getAuth, signInWithRedirect, getRedirectResult } from "firebase/auth";
const LoginSceen = (props) => {
console.log(signInWithRedirect) //return undefined
console.log(getRedirectResult ) //return undefined
console.log(getAuth) //return [Function getAuth]
console.log(GoogleAuthProvider) //return [Function GoogleAuthProvider]
return (
<View style={{ flex: 1, backgroundColor: "#9297C4" }}>
</View>
);
}
export default LoginSceen;
PS: the error i get is TypeError: _auth.signInWithRedirect is not a function
firebase version in my package.json "firebase": "^9.6.0",
here the getAuth function detected by vscode IntelliSense
here the signInWithRedirect function who appear as undefined in my console but detected too by IntelliSense
There is no solution: since
React Native does not export the signInWIthPopup and signInWithReactNative entrypoints since both of these functions directly modify the DOM
And here the response i get from the Firebase team on my github isue: https://github.com/firebase/firebase-js-sdk/issues/5837#issuecomment-1005038520
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.