커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
expo-auth-session
앱개발 종합반 - 리액트 네이티브 v7
기타
북마크
박*수
댓글
3
추천
0
조회수
5
조회수
5
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


expo-google-app-auth가 서비스 종료됬다는 말씀을 듣고 expo-auth-session으로 소셜로그인 시도 중인데..

위와 같이 에러가 뜨는데 왜이럴까요...



보고 계신 화면 전체를 캡처해

스파르타 즉문즉답

주시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.




작성한 코드 및 에러 메세지

import * as React from 'react';

import * as WebBrowser from 'expo-web-browser';

import { ResponseType } from 'expo-auth-session';

import * as Google from 'expo-auth-session/providers/google';

import { initializeApp } from 'firebase/app';

import { getAuth, GoogleAuthProvider, signInWithCredential, onAuthStateChanged } from 'firebase/auth';

import { Button } from 'react-native';


// Initialize Firebase

initializeApp({

  /* Config */

});


WebBrowser.maybeCompleteAuthSession();


export default function LoginPage() {


  const [request, response, promptAsync] = Google.useIdTokenAuthRequest(

    {

      clientId: 'xxxx',

    },

  );


  React.useEffect(() => {

    if (response?.type === 'success') {

      const { id_token } = response.params;

      const auth = getAuth();

      const credential = GoogleAuthProvider.credential(id_token);

      signInWithCredential(auth, credential);

    }

  }, [response]);

 

  onAuthStateChanged(auth, async (user) => {

    if (user) {

      const { uid, email, displayName, accessToken } = user;

      console.log("uid :", uid)

      console.log("email :", email)

      console.log("displayName :", displayName)

      console.log("accessToken :", accessToken)

    }

  });

 

  return (

    <Button

      disabled={!request}

      title="Login"

      onPress={() => {

        promptAsync();

      }}

    />

  );

}



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴