@@ -2149,13 +2149,15 @@ public void run() {
2149
2149
2150
2150
boolean urlOpened = false ;
2151
2151
boolean defaultOpenActionDisabled = "DISABLE" .equals (OSUtils .getManifestMeta (context , "com.onesignal.NotificationOpened.DEFAULT" ));
2152
+ boolean launchUrlSuppress = "true" .equals (OSUtils .getManifestMeta (context , "com.onesignal.suppressLaunchURLs" ));
2152
2153
2153
- if (!defaultOpenActionDisabled )
2154
+ if (!defaultOpenActionDisabled && ! launchUrlSuppress )
2154
2155
urlOpened = openURLFromNotification (context , data );
2155
2156
2156
- logger .debug ("handleNotificationOpen from context: " + context + " with fromAlert: " + fromAlert + " urlOpened: " + urlOpened + " and defaultOpenActionDisabled: " + defaultOpenActionDisabled );
2157
+ logger .debug ("handleNotificationOpen from context: " + context + " with fromAlert: " + fromAlert + " urlOpened: " + urlOpened + " defaultOpenActionDisabled: " + defaultOpenActionDisabled
2158
+ + " launchUrlSuppress: " + defaultOpenActionDisabled );
2157
2159
// Check if the notification click should lead to a DIRECT session
2158
- if (shouldInitDirectSessionFromNotificationOpen (context , fromAlert , urlOpened , defaultOpenActionDisabled )) {
2160
+ if (shouldInitDirectSessionFromNotificationOpen (context , fromAlert , urlOpened , defaultOpenActionDisabled , launchUrlSuppress )) {
2159
2161
applicationOpenedByNotification (notificationId );
2160
2162
}
2161
2163
@@ -2188,13 +2190,15 @@ static boolean startOrResumeApp(Activity inContext) {
2188
2190
* 1. App is not an alert
2189
2191
* 2. Not a URL open
2190
2192
* 3. Manifest setting for com.onesignal.NotificationOpened.DEFAULT is not disabled
2191
- * 4. App is coming from the background
2192
- * 5. App open/resume intent exists
2193
+ * 4. Manifest setting for com.onesignal.suppressLaunchURLs is not true
2194
+ * 5. App is coming from the background
2195
+ * 6. App open/resume intent exists
2193
2196
*/
2194
- private static boolean shouldInitDirectSessionFromNotificationOpen (Activity context , boolean fromAlert , boolean urlOpened , boolean defaultOpenActionDisabled ) {
2197
+ private static boolean shouldInitDirectSessionFromNotificationOpen (Activity context , boolean fromAlert , boolean urlOpened , boolean defaultOpenActionDisabled , boolean launchUrlSuppress ) {
2195
2198
return !fromAlert
2196
2199
&& !urlOpened
2197
2200
&& !defaultOpenActionDisabled
2201
+ && !launchUrlSuppress
2198
2202
&& !inForeground
2199
2203
&& startOrResumeApp (context );
2200
2204
}
0 commit comments