Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

416
Vistas
Why do I get UNKNOWN/CUSTOM URL SCHEME error in React Native Expo Google/Facebook login?

I have a react native expo managed workflow project with Firebase backend set up. On android emulator facebook and google login WORKS with firebase, however when I release the apk (expo build:android) I get the following error during redirect: "UNKNOWN/CUSTOM URL SCHEME"

I use the following packeges: Google with expo-auth-session Facebook with expo-facebook

enter image description here

Since it works in emulator, I am pretty sure my Secrets, ID's and redirect URL's are okay, it redirects me without any problem. Also firebase created the google cloud profile for me, I just added the valid Oauth redirect URI's to my WEB ID settings. Same for facebook, added the firebase redirect URL, as well as the expo one.

I tried to add "scheme":"myapp" to app.json, but no luck. Not sure what to do...

import {GoogleAuthProvider, FacebookAuthProvider, signInWithCredential} from 'firebase/auth';
import * as Facebook from 'expo-facebook';
import * as Google from 'expo-auth-session/providers/google';
import * as WebBrowser from 'expo-web-browser';

WebBrowser.maybeCompleteAuthSession();

//Google
const [request, response, promptAsync] = Google.useIdTokenAuthRequest(
    {
      clientId: 'xxxxxxxxxxxxxxxxxxxx24u2l7k576m03n.apps.googleusercontent.com',
      redirectUriOptions: {
        // scheme: 'com.graphite.ekisallatkonyv',
        useProxy: true,
      },
      },
  );
  React.useEffect(() => {
    if (response?.type === 'success') {
        const { id_token } = response.params;
  
        const credential = GoogleAuthProvider.credential(id_token);
        signInWithCredential(auth, credential)
        .then((result) => {
            addDefaultData(result.user.uid)
        });
    }
  }, [response]);


const google_login_ButtonClick = async() => {
    promptAsync({useProxy: true,showInRecents: true})
}


const facebook_login = async() => {
    try {
        await Facebook.initializeAsync({
          appId: FBAPPID,
        });
        const { type, token } =
          await Facebook.logInWithReadPermissionsAsync({
            permissions: ['public_profile', 'email'],
          });
        if (type === 'success') {
          const credential = FacebookAuthProvider.credential(token)
          signInWithCredential(auth, credential)
          .then((result) => {
            addDefaultData(result.user.uid)
          })
        } else {
          // type === 'cancel'
        }
      } catch ({ message }) {
        Alert.alert(`ERROR: ${message}`);
      }
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This has nothing to with the app, I had a similar problem but for me, it is working in the build release but not in the emulator

Here are the steps that I followed:

  • Go to the Google Play console and copy the SHA-1 key from Release -> Setup -> App Integrity
  • Go to Google Cloud Platform Console and click Create Credentials -> OAuthClientID. Choose type Android and paste the hash and fill in the form
  • Create another Client by clicking Create Credentials, but choose type Web application this time.
  • Use the WebClient in your code

React-native google signin gives Developer Error

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda