Skip to content

Commit

Permalink
leveraged launch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehan27 committed Oct 18, 2023
1 parent 25d5975 commit 2179847
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions messagingpush/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
android:name=".activity.NotificationClickReceiverActivity"
android:excludeFromRecents="true"
android:exported="true"
android:launchMode="singleTop"
android:noHistory="true"
android:taskAffinity=""
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,6 @@ internal class CustomerIOPushNotificationHandler(
): PendingIntent {
val notifyIntent = Intent(context, NotificationClickReceiverActivity::class.java)
notifyIntent.putExtra(NotificationClickReceiverActivity.NOTIFICATION_PAYLOAD_EXTRA, payload)
// Without these flags, Android OS does not launch activity again in one session if the activity was recently launched
notifyIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
// In Android M, you must specify the mutability of each PendingIntent
val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
Expand Down

0 comments on commit 2179847

Please sign in to comment.