From 0c653b0a712710e40fd9ec326526178d3b84c0b5 Mon Sep 17 00:00:00 2001 From: Amit Davidi Date: Thu, 11 Jan 2018 12:43:12 +0200 Subject: [PATCH] Fix nondistinct pending intent bug --- .../core/NotificationIntentAdapter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java b/android/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java index 0413e2f..3af598b 100644 --- a/android/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java +++ b/android/src/main/java/com/wix/reactnativenotifications/core/NotificationIntentAdapter.java @@ -8,12 +8,11 @@ import android.os.Bundle; import com.wix.reactnativenotifications.core.notification.PushNotificationProps; public class NotificationIntentAdapter { - private static final int PENDING_INTENT_CODE = 0; private static final String PUSH_NOTIFICATION_EXTRA_NAME = "pushNotification"; public static PendingIntent createPendingNotificationIntent(Context appContext, Intent intent, PushNotificationProps notification) { intent.putExtra(PUSH_NOTIFICATION_EXTRA_NAME, notification.asBundle()); - return PendingIntent.getService(appContext, PENDING_INTENT_CODE, intent, PendingIntent.FLAG_ONE_SHOT); + return PendingIntent.getService(appContext, (int) System.currentTimeMillis(), intent, PendingIntent.FLAG_ONE_SHOT); } public static Bundle extractPendingNotificationDataFromIntent(Intent intent) { -- 2.26.2