Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

497
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda