diff --git a/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java b/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java index 13e238f..4d38674 100644 --- a/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java +++ b/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java @@ -109,7 +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 Google"); + mWebView.getSettings().setUserAgentString("Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0"); LayoutParams layoutParams = this.getFullscreenLayoutParams(context); diff --git a/android/src/main/java/io/fullstack/oauth/OAuthManagerProviders.java b/android/src/main/java/io/fullstack/oauth/OAuthManagerProviders.java index d91b4b5..2f9b5e1 100644 --- a/android/src/main/java/io/fullstack/oauth/OAuthManagerProviders.java +++ b/android/src/main/java/io/fullstack/oauth/OAuthManagerProviders.java @@ -264,23 +264,15 @@ private static ServiceBuilder _oauth2ServiceBuilder( String scopes = ""; if (cfg.containsKey("scopes")) { scopes = (String) cfg.get("scopes"); - String scopeStr = OAuthManagerProviders.getScopeString(scopes, ","); + String scopeStr = OAuthManagerProviders.getScopeString(scopes, " "); builder.scope(scopeStr); } - boolean rawScopes = (cfg.containsKey("rawScopes") && ((String)cfg.get("rawScopes")).equalsIgnoreCase("true")); - if (opts != null && opts.hasKey("scopes")) { scopes = (String) opts.getString("scopes"); - String scopeStr = null; - - if (!rawScopes) - scopeStr = OAuthManagerProviders.getScopeString(scopes, ","); - else - scopeStr = scopes; - + String scopeStr = OAuthManagerProviders.getScopeString(scopes, " "); builder.scope(scopeStr); - } + } if (callbackUrl != null) { builder.callback(callbackUrl); @@ -296,7 +288,7 @@ private static String getScopeString( final String scopes, final String joinBy ) { - List array = Arrays.asList(scopes.replaceAll("\\s", "").split("[ ,]+")); + List array = Arrays.asList(scopes.replaceAll("\\s", "").split("[,]+")); Log.d(TAG, "array: " + array + " (" + array.size() + ") from " + scopes); return TextUtils.join(joinBy, array); } diff --git a/package.json b/package.json index 34a83b3..8212c5c 100644 --- a/package.json +++ b/package.json @@ -30,18 +30,6 @@ "react": "*", "react-native": "*" }, - "rnpm": { - "commands": { - "prelink": "node_modules/react-native-oauth/bin/prepare.sh", - "postlink": "node_modules/react-native-oauth/bin/cocoapods.sh" - }, - "ios": { - "project": "ios/OAuthManager.xcodeproj" - }, - "android": { - "packageInstance": "new OAuthManagerPackage()" - } - }, "dependencies": { "invariant": "^2.2.1", "valib": "^2.0.0"