Last active
March 7, 2018 13:42
-
-
Save ilake/6107b49dc14d0389c16d46fe72c5f866 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let redirectUrl = Expo.AuthSession.getRedirectUrl(); | |
let response = await Expo.AuthSession.startAsync({ | |
authUrl: | |
`https://accounts.google.com/o/oauth2/v2/auth?` + | |
`&client_id=${GOOGLE_WEB_APP_ID}` + | |
`&redirect_uri=${encodeURIComponent(redirectUrl)}` + | |
`&response_type=code` + | |
`&access_type=offline` + | |
`&prompt=consent` + | |
`&scope=${encodeURIComponent('https://www.googleapis.com/auth/plus.profile.emails.read https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/contacts')}`, | |
}); | |
// response is like | |
// { type: "success", | |
// errorCode: undefined, | |
// url: "exp://localhost:19000/+expo-auth-session?code=4%2F…dVIg_D5axLSsDNjl9VIN_qTYcxH4ZQzEUGj_71OHxQo-9NLS8", | |
// params: { | |
// code: "4/AAAHF_zoV_I89Odu2qn5aX6ehHFZp1KKKMrTUhdVIg_D5axLSsDNjl9VIN_qTYcxH4ZQzEUGj_71OHxQo-9NLS8" | |
// } | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment