Open tomprogers opened 7 years ago
I got it working.
For iOS don't bother trying to add a URL at all on Facebook Login/Settings/"Valid OAuth redirect URIs" field. That field will not accept a iOS scheme, only http://
or https://
schemes.
Instead go to https://developers.facebook.com/apps/<your id>/settings/
If you do not have an "iOS" platform, click that "+ Add Platform" button at the bottom, and add iOS. For both the "Bundle ID" and "URL Scheme Suffix (Optional)" add the fb{YOUR_APP_ID} as suggested.
Then in XTools, setup your scheme
and in React,
oauthManager.configure({
twitter: {
consumer_key: WebAppConfig.SOCIAL_AUTH_TWITTER_KEY,
consumer_secret: WebAppConfig.SOCIAL_AUTH_TWITTER_SECRET,
callback_url: (Platform.OS === 'ios') ? "wevotetwitterscheme://twitter_sign_in" : "http://localhost/twitter",
},
facebook: {
client_id: WebAppConfig.SOCIAL_AUTH_FACEBOOK_KEY,
client_secret: WebAppConfig.SOCIAL_AUTH_FACEBOOK_SECRET,
callback_url: "fb1097389196952441://authorize",
}
Per the instructions in the readme, I tried to register a new OAuth Redirect URI via Facebook's dev site. Here's the relevant part:
Facebook won't accept the new redirect URL scheme. It says:
I know this isn't exactly a bug in react-native-oauth, but it certainly suggests the instructions in this repo are no longer accurate, which seems like a valid doc issue.