import * as React from 'react';
import { View, Text, FlatList, Button } from 'react-native';
import * as WebBrowser from 'expo-web-browser';
import * as AuthSession from 'expo-auth-session';
const redirection = AuthSession.makeRedirectUri({
native: 'path://',
useProxy: true
});
function MyComponent() {
const authRequest = AuthSession.useAuthRequest({
clientId: 'G545-YU32-IOW3-453D',
redirectUri: redirection,
scopes: [ 'profile', 'email' ]
},
AuthSession.useAutoDiscovery();
);
const [ request, result, prompt ] = authRequest;
return (
<View>
<Button
title="Log In"
disabled={!request}
onPress={() => promptAsync({ useProxy: true })}
/>
</View>
);
}