-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to log in via Facebook on Android #231
Comments
So, I managed to fix this by changing one line in the
Happy to send a PR if this is the recommended way of fixing it 🙂 |
So, the above snippet works if you're only working with facebook, but obviously breaks the other providers. The final snippet looks like this: patch-package
--- a/node_modules/react-native-oauth/android/src/main/java/io/fullstack/oauth/OAuthManagerModule.java
+++ b/node_modules/react-native-oauth/android/src/main/java/io/fullstack/oauth/OAuthManagerModule.java
@@ -114,7 +114,12 @@ class OAuthManagerModule extends ReactContextBaseJavaModule {
final String authVersion = (String) cfg.get("auth_version");
Activity activity = this.getCurrentActivity();
FragmentManager fragmentManager = activity.getFragmentManager();
- String callbackUrl = "http://localhost/" + providerName;
+ String callbackUrl;
+ if (providerName.equals("facebook")) {
+ callbackUrl = "https://localhost/" + providerName;
+ } else {
+ callbackUrl = "http://localhost/" + providerName;
+ }
OAuthManagerOnAccessTokenListener listener = new OAuthManagerOnAccessTokenListener() {
public void onRequestTokenError(final Exception ex) { |
@maxcodes Hi max, I have question. This code you put above work also when the user is using LTE not wifi? My question is because use localhost , is okay that for LTE ? Thanks |
Hey @francoro, I don't remember that being a problem, since localhost always refers to the local device. Cheers! |
I'm having the exact same issue as #202. Copy-pasta:
This is only on Android. iOS works fine.
It seems the issue is related to the default callback:
http://localhost/facebook
. Facebook doesn't allow http callbacks anymore, so we're kind of stuck here. I tried all possible combinations of settings, even triedhttps://localhost/facebook
just for the funz, but that didn't work either.I'm investigating and can probably send a PR fix, but any pointers would be very helpful. Thanks!
The text was updated successfully, but these errors were encountered: