react-native-notify-kit 10.9.0 → 10.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/app/notifee/core/EventBus.java +4 -0
- package/android/src/main/java/app/notifee/core/FullScreenNotificationActivity.java +76 -0
- package/android/src/main/java/app/notifee/core/InitialNotificationLedger.java +262 -0
- package/android/src/main/java/app/notifee/core/Notifee.java +142 -20
- package/android/src/main/java/app/notifee/core/NotificationManager.java +44 -6
- package/android/src/main/java/app/notifee/core/NotificationPendingIntent.java +14 -0
- package/android/src/main/java/app/notifee/core/NotificationReceiverHandler.java +11 -2
- package/android/src/main/java/app/notifee/core/event/InitialNotificationEvent.java +15 -0
- package/android/src/test/java/app/notifee/core/NotifeeGetInitialNotificationTest.java +3805 -0
- package/cli/package.json +1 -1
- package/dist/types/Module.d.ts +10 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/types/Module.ts +10 -3
- package/src/version.ts +1 -1
|
@@ -19,6 +19,7 @@ package app.notifee.core;
|
|
|
19
19
|
|
|
20
20
|
import static app.notifee.core.NotificationPendingIntent.EVENT_TYPE_INTENT_KEY;
|
|
21
21
|
import static app.notifee.core.NotificationPendingIntent.NOTIFICATION_ID_INTENT_KEY;
|
|
22
|
+
import static app.notifee.core.NotificationPendingIntent.PENDING_INTENT_ID_INTENT_KEY;
|
|
22
23
|
import static app.notifee.core.event.NotificationEvent.TYPE_ACTION_PRESS;
|
|
23
24
|
import static app.notifee.core.event.NotificationEvent.TYPE_PRESS;
|
|
24
25
|
|
|
@@ -98,7 +99,11 @@ public class NotificationReceiverHandler {
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
InitialNotificationEvent initialNotificationEvent =
|
|
101
|
-
new InitialNotificationEvent(
|
|
102
|
+
new InitialNotificationEvent(
|
|
103
|
+
notificationModel,
|
|
104
|
+
extras,
|
|
105
|
+
InitialNotificationLedger.recordTap(
|
|
106
|
+
intent.getStringExtra(PENDING_INTENT_ID_INTENT_KEY)));
|
|
102
107
|
EventBus.postSticky(initialNotificationEvent);
|
|
103
108
|
|
|
104
109
|
// Send event
|
|
@@ -127,7 +132,11 @@ public class NotificationReceiverHandler {
|
|
|
127
132
|
EventBus.post(new NotificationEvent(TYPE_PRESS, notificationModel, extras));
|
|
128
133
|
|
|
129
134
|
InitialNotificationEvent initialNotificationEvent =
|
|
130
|
-
new InitialNotificationEvent(
|
|
135
|
+
new InitialNotificationEvent(
|
|
136
|
+
notificationModel,
|
|
137
|
+
extras,
|
|
138
|
+
InitialNotificationLedger.recordTap(
|
|
139
|
+
intent.getStringExtra(PENDING_INTENT_ID_INTENT_KEY)));
|
|
131
140
|
EventBus.postSticky(initialNotificationEvent);
|
|
132
141
|
|
|
133
142
|
if (pressActionBundle == null) {
|
|
@@ -26,10 +26,21 @@ public class InitialNotificationEvent {
|
|
|
26
26
|
|
|
27
27
|
private NotificationModel notificationModel;
|
|
28
28
|
private Bundle extras;
|
|
29
|
+
private long tapSequence;
|
|
29
30
|
|
|
30
31
|
public InitialNotificationEvent(NotificationModel notificationModel, Bundle extras) {
|
|
32
|
+
this(notificationModel, extras, 0);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param tapSequence sequence number recorded for the tap that produced this event, or 0 when the
|
|
37
|
+
* tap is not tracked.
|
|
38
|
+
*/
|
|
39
|
+
public InitialNotificationEvent(
|
|
40
|
+
NotificationModel notificationModel, Bundle extras, long tapSequence) {
|
|
31
41
|
this.notificationModel = notificationModel;
|
|
32
42
|
this.extras = extras;
|
|
43
|
+
this.tapSequence = tapSequence;
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
public NotificationModel getNotificationModel() {
|
|
@@ -40,6 +51,10 @@ public class InitialNotificationEvent {
|
|
|
40
51
|
return extras;
|
|
41
52
|
}
|
|
42
53
|
|
|
54
|
+
public long getTapSequence() {
|
|
55
|
+
return tapSequence;
|
|
56
|
+
}
|
|
57
|
+
|
|
43
58
|
public Map<String, Object> toMap() {
|
|
44
59
|
Map<String, Object> initialNotificationEventMap = new HashMap<>();
|
|
45
60
|
initialNotificationEventMap.put("notificationModel", notificationModel.toBundle());
|