From 7426e1ab6600d4b325b572693d58e401d774b069 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Fri, 8 Sep 2017 12:37:42 +1000 Subject: [PATCH] Fix for non mobile friendly pages in Android Using a User Agent String created from the native webview makes the login pages appear in their mobile friendly form Signed-off-by: Robin Tang --- .../java/io/fullstack/oauth/OAuthManagerDialogFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java b/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java index 13e238f..728e460 100644 --- a/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java +++ b/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java @@ -109,7 +109,9 @@ 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 Google"); + // mWebView.getSettings().setUserAgentString("Mozilla/5.0 Google"); + String userAgent = new WebView(mReactContext.getApplicationContext()).getSettings().getUserAgentString(); + mWebView.getSettings().setUserAgentString(userAgent); LayoutParams layoutParams = this.getFullscreenLayoutParams(context);