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

496
Vistas
Request not being completed with Expo authSession

I'm quite new to app development and have ran into an error while trying to set up Google authentication, but it appears the request hasn't finished loading.

(Error message is: [Unhandled promise rejection: Error: Cannot prompt to authenticate until the request has finished loading.])

I'm not sure how I can work around this issue, perhaps some more experienced developers answer my question?

import React, { useState, useEffect } from 'react';
import { View, Text, Button, StyleSheet, TextInput } from 'react-native';
import { useAuthRequest } from 'expo-auth-session';
import * as WebBrowser from 'expo-web-browser';

WebBrowser.maybeCompleteAuthSession();

const App = () => {
    const [accessToken, setAccessToken] = useState();
    const [request, response, promptAsync] = useAuthRequest({
        iosClientId: "701989901250-95eku3luaf6qj1q0ba82dmeun3v4f486.apps.googleusercontent.com",
        expoClientId: "701989901250-ieiupvqri2hskpacksaoe7r6vjmu3e24.apps.googleusercontent.com",
        //androidClientId: "",
    });

    useEffect(() => {
        if (response?.type === "success") {
          setAccessToken(response.authentication.accessToken);
        }
      }, [response]);

    return (
        <View>
            <Button styles={styles.button} title="Sign-in with Google" /* google login button */
            onPress={() => { promptAsync({useProxy: false, showInRecents: true}) }}/>
        </View>
    );
}

EDIT: For those interested I did find a fix for this error, it was a weird issue, but all I changed was the third line and the tenth line.

// third
import * as Google from 'expo-auth-session/providers/google';
// tenth
const [request, response, promptAsync] = Google.useAuthRequest({
about 4 years ago · Juan Pablo Isaza
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