I am trying to implement google authentication with firebase following the steps on this expo Authentication documentation, Google section:
using the:
- expo-cli 5.2.0
- expo managed workflow
This following is part of my codebase for the google authentication:
import { StyleSheet, Text, View } from “react-native”;
import React, { useEffect } from “react”;
import { Button } from “react-native-elements”;
import AppIcon from “…/icons/AppIcon”;
import appColors from “…/…/appStyle/appColors”;
import firebase from “firebase”;
import Firebase from “…/…/config/firebase”;
import * as WebBrowser from “expo-web-browser”;
import * as Google from “expo-auth-session/providers/google”;
WebBrowser.maybeCompleteAuthSession();
export default function GoogleSignInButton() {
const [request, response, promptAsync] = Google.useIdTokenAuthRequest({
clientId:
“…apps.googleusercontent.com”,
androidClientId:
“…apps.googleusercontent.com”,
});
React.useEffect(() => {
if (response?.type === “success”) {
try {
const { id_token } = response.params;
const auth = Firebase.auth();
const credential =
firebase.auth.GoogleAuthProvider.credential(id_token);
firebase
.auth()
.signInWithCredential(credential)
.catch((error) => {
});
} catch (error) {
}
}
}, [response]);
…}
When I run the code with “expo start” I get the following error on the terminal:
Error: Cannot use AuthSession proxy because the project ID is not defined. Please report this as a bug with the contents of expo config --type public
.
Does someone know how I can solve this?
I could not find answers online.