expo React Native Google Login API 사용법

전채원·2022년 1월 27일
0

App Setup

On your terminal input the following commands:

터미널에 다음 명령들을 입력:

npm install -g expo-cli 
expo init your-project-name
cd your-project-name
expo install @react-navigation/native react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view @react-navigation/stack
expo install expo-google-app-auth
expo start

./screens folder with a LoginScreen.js and ProfileScreen.js files.

스크린이라는 폴더를 만들어서 로그인스크린과 프로필스크린 파일을 만든다.

Coding time!

Warning: After coding, you have to setup the app on the Google Console. It won’t work until you do so

아래있는 본래 포스팅에 있는 코드를 이름이 맞는 코드에 복사 붙여넣기 한다.

Google Console Project Setup

Create a new Google Console project on the following link

이 링크에서 새로운 콘솔 프로젝트를 만든 후 검색창에 API를 쳐서
API 및 서비스를 선택해 들어간다.

그 후 포스팅이 시키는 것을 차근차근 따라가는데,

IMPORTANT: In order to get it working on your expo local environment, you have to input “host.exp.exponent” as the Bundle ID.

expo를 사용하는 분들은 이 host.exp.exponent를 IOS의 Bundle ID와 Android의 PackgeName에 입력해주시면 됩니다.

이후 시키는데로 하면 금세 구글 로그인 api가 어플에서 작동합니다!!

*본 포스팅은 -> 블로그 글을 토대로 작성되었습니다.

0개의 댓글