Skip to content

Commit a0332db

Browse files
authored
Merge pull request OutSystems#2 from OutSystems/RNMT-1614
RNMT-1614 - Remove Intent Flags to deal with Deepllinks properly
2 parents c91b8ac + 245220e commit a0332db

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

OneSignalSDK/onesignal/src/main/java/com/onesignal/OneSignal.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,6 @@ private static boolean openURLFromNotification(Context context, JSONArray dataAr
16121612
int jsonArraySize = dataArray.length();
16131613

16141614
boolean urlOpened = false;
1615-
Intent intent = null;
16161615

16171616
for (int i = 0; i < jsonArraySize; i++) {
16181617
try {
@@ -1624,19 +1623,11 @@ private static boolean openURLFromNotification(Context context, JSONArray dataAr
16241623

16251624
if (customJSON.has("u")) {
16261625
String url = customJSON.optString("u", null);
1627-
16281626
if (!url.contains("://"))
16291627
url = "http://" + url;
16301628

1631-
if (!url.startsWith("http")) {
1632-
intent = new Intent(Intent.ACTION_MAIN, Uri.parse(url.trim()));
1633-
intent.addCategory(Intent.CATEGORY_LAUNCHER);
1634-
}
1635-
else
1636-
intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url.trim()));
1637-
1638-
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET |Intent.FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
1639-
1629+
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url.trim()));
1630+
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET |Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
16401631
context.startActivity(intent);
16411632
urlOpened = true;
16421633
}

0 commit comments

Comments
 (0)