From e72cc08b11cc24c4547bb38da007784ef02e6cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=E1=BB=A9c?= Date: Wed, 13 Mar 2019 11:53:42 +0700 Subject: [PATCH 1/3] user agent issue when use google log in on android --- .../main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java | 1 + 1 file changed, 1 insertion(+) diff --git a/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java b/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java index 12202bb..2bfc6e5 100644 --- a/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java +++ b/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java @@ -109,6 +109,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa mWebView.setVisibility(View.VISIBLE); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setDomStorageEnabled(true); + mWebView.getSettings().setUserAgentString("Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19"); LayoutParams layoutParams = this.getFullscreenLayoutParams(context); From aed98af696df8e1be69f796ca2d3d4e8d0a94681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=E1=BB=A9c?= Date: Wed, 13 Mar 2019 11:58:40 +0700 Subject: [PATCH 2/3] Fix Facebook login issue on Android --- .../main/java/io/fullstack/oauth/OAuthManagerModule.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/io/fullstack/oauth/OAuthManagerModule.java b/android/src/main/java/io/fullstack/oauth/OAuthManagerModule.java index 4ac136f..1e108d2 100644 --- a/android/src/main/java/io/fullstack/oauth/OAuthManagerModule.java +++ b/android/src/main/java/io/fullstack/oauth/OAuthManagerModule.java @@ -114,7 +114,12 @@ public void authorize( 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) { From 43a7994ea3f166ea83feda2f371d92949541283f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=E1=BB=A9c?= Date: Mon, 18 Mar 2019 09:55:32 +0700 Subject: [PATCH 3/3] requiresMainQueueSetup --- ios/OAuthManager/OAuthManager.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ios/OAuthManager/OAuthManager.m b/ios/OAuthManager/OAuthManager.m index 2e51cea..0e43525 100644 --- a/ios/OAuthManager/OAuthManager.m +++ b/ios/OAuthManager/OAuthManager.m @@ -40,6 +40,11 @@ - (dispatch_queue_t)methodQueue return dispatch_queue_create("io.fullstack.oauth", DISPATCH_QUEUE_SERIAL); } ++ (BOOL)requiresMainQueueSetup +{ + return YES; +} + + (instancetype)sharedManager { dispatch_once(&onceToken, ^{ manager = [self new];