I’m implementing AuthSession Facebook provider. According to documents in app.json we need to define facebookScheme and it should be something like fbYOUR FBID.
Facebook provider later uses this scheme for redirectUrl adding :/authorize in the end of facebookScheme.
Everything works fine in Expo client with proxy redirect.
The problem is this doesn’t work like it should when building a standalone app.The only way I managed to get this working and get the response that I needed(authorization code) is to populate scheme prop in app.json with the same value as facebookScheme.
Hello mate I was just able to solve it now. I’m gonna share with you the steps below so you can try.
1- Change “scheme” in app.json to anything you wish.
2- “facebookScheme” in app.json put it as “fb”
3- Use this code for the login process:
const redirectUri = makeRedirectUri({
useProxy: true
});
const [request, response, promptAsync] = Facebook.useAuthRequest({
clientId: '<APPID>',
scopes: ['public_profile', 'user_likes'],
redirectUri: redirectUri,
responseType: ResponseType.Code,
}, {
authorizationEndpoint: 'https://www.facebook.com/v6.0/dialog/oauth',
tokenEndpoint: 'https://graph.facebook.com/v6.0/oauth/access_token'
});
React.useEffect(() => {
if (response?.type === 'success') {
const { code } = response.params;
//Now you have the code which you can exchange with access token and you can move on from here as you wish
}
}, [response]);
Have you tried this in standalone app, when you build apk?
Bacause for me Facebook AuthSession works in Expo when proxy redirect is used, but when building standalone I have issue that is described in the first post.