I try to build an eCommerce app with Expo and react native but I face a network error, the google service is active on the device (simulator for android and real iPhone for IOS) and I'm connected to my Google account.
I also try to prevent the page to reload but nothing changed. After some research, all I see is I'm not the only one to face this error I don't find any valuable answer so I'm ending up here.
here my code:
const LoginScreen = () => {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [isSignedIn, setIsSignedIn] = useState(false);
const handleCreateAccount = (e) => {
e.preventDefault();
createUserWithEmailAndPassword(authentification, email, password)
.then((userCredential) => {
console.log(userCredential);
})
.catch((error) => {
console.log(error.message);
});
};
const handleSignIn = (e) => {
e.preventDefault();
signWithEmailAndPassword(auth, email, password)
.then((userCredential) => {
console.log("Signed in!");
const user = userCredential.user;
console.log(user);
})
.catch((error) => {
console.log(error);
Alert.alert(error.message);
});
};
<ScrollView
contentContainerStyle={{
flex: 1,
width: "100%",
height: "100%",
alignItems: "center",
justifyContent: "center",
}}
>
<BlurView intensity={100}>
<View style={styles.login}>
<Image
source={{ uri: profilePicture }}
style={styles.profilePicture}
/>
<Text style={{ fontSize: 17, fontWeight: "400", color: "white" }}>
email
</Text>
<TextInput
onChangeText={(text) => setEmail(text)}
style={styles.input}
placeholder="your@email.com"
keyboardType="email-address"
textContentType="emailAddress"
/>
<Text style={{ fontSize: 17, fontWeight: "400", color: "white" }}>
mot de passe
</Text>
<TextInput
onChange={(text) => setPassword(text)}
style={styles.input}
placeholder="your password"
secureTextEntry={true}
/>
<Button
onPress={handleSignIn}
title="Connexion"
buttonStyle={{
width: 250,
height: 40,
borderRadius: 10,
backgroundColor: "#00CFEB90",
alignItems: "center",
justifyContent: "center",
marginVertical: 10,
borderColor: "#fff",
borderWidth: 2,
}}
type="outline"
titleStyle={{ color: "white", fontSize: 17 }}
/>
<Button
onPress={handleCreateAccount}
title="Créer un compte"
buttonStyle={{
width: 250,
height: 40,
borderRadius: 10,
backgroundColor: "#6792F090",
alignItems: "center",
justifyContent: "center",
marginVertical: 10,
borderColor: "#fff",
borderWidth: 2,
}}
type="outline"
titleStyle={{ color: "white", fontSize: 17 }}
/>
</View>
</BlurView>
</ScrollView>
So I need help.