From 47759fa6ea915eb2217b1250f3273f80e26d871c Mon Sep 17 00:00:00 2001 From: Luciano Balmaceda Date: Mon, 29 Jan 2018 17:02:57 -0300 Subject: [PATCH 1/2] fix android web auth --- android/src/main/java/com/auth0/react/A0Auth0Module.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/src/main/java/com/auth0/react/A0Auth0Module.java b/android/src/main/java/com/auth0/react/A0Auth0Module.java index 65081200..0d9b4b9a 100644 --- a/android/src/main/java/com/auth0/react/A0Auth0Module.java +++ b/android/src/main/java/com/auth0/react/A0Auth0Module.java @@ -60,12 +60,11 @@ public void showUrl(String url, boolean closeOnLoad, Callback callback) { if (activity != null) { CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(); CustomTabsIntent customTabsIntent = builder.build(); - customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); - customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); customTabsIntent.launchUrl(activity, Uri.parse(url)); } else { final Intent intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setData(Uri.parse(url)); getReactApplicationContext().startActivity(intent); } From 301858b2b0c2b9f5c2e79e14cdab774744f6f8ca Mon Sep 17 00:00:00 2001 From: Luciano Balmaceda Date: Mon, 29 Jan 2018 18:43:28 -0300 Subject: [PATCH 2/2] remove NO_HISTORY flag to avoid state loss on pause --- android/src/main/java/com/auth0/react/A0Auth0Module.java | 1 - 1 file changed, 1 deletion(-) diff --git a/android/src/main/java/com/auth0/react/A0Auth0Module.java b/android/src/main/java/com/auth0/react/A0Auth0Module.java index 0d9b4b9a..1eb87ec0 100644 --- a/android/src/main/java/com/auth0/react/A0Auth0Module.java +++ b/android/src/main/java/com/auth0/react/A0Auth0Module.java @@ -63,7 +63,6 @@ public void showUrl(String url, boolean closeOnLoad, Callback callback) { customTabsIntent.launchUrl(activity, Uri.parse(url)); } else { final Intent intent = new Intent(Intent.ACTION_VIEW); - intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setData(Uri.parse(url)); getReactApplicationContext().startActivity(intent);