react-native-notify-kit 10.8.1 → 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 +35 -18
- package/android/build.gradle +50 -4
- package/android/src/main/AndroidManifest.xml +15 -0
- package/android/src/main/java/app/notifee/core/EventBus.java +4 -0
- package/android/src/main/java/app/notifee/core/ForegroundService.java +395 -5
- package/android/src/main/java/app/notifee/core/ForegroundServiceRunLimitReceiver.java +15 -0
- package/android/src/main/java/app/notifee/core/ForegroundServiceRunLimitScheduler.java +461 -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 +50 -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/main/java/app/notifee/core/event/NotificationEvent.java +6 -0
- package/android/src/main/java/app/notifee/core/model/NotificationAndroidModel.java +29 -0
- package/android/src/main/kotlin/io/invertase/notifee/NotifeeEventSubscriber.kt +3 -0
- package/android/src/test/java/app/notifee/core/ForegroundServiceRunLimitTest.java +2357 -0
- package/android/src/test/java/app/notifee/core/ForegroundServiceTest.java +23 -13
- package/android/src/test/java/app/notifee/core/NotifeeGetInitialNotificationTest.java +3805 -0
- package/android/src/test/java/app/notifee/core/ShadowServiceCompatibilityTest.java +170 -0
- package/android/src/test/resources/robolectric.properties +4 -0
- package/cli/dist/cli.js +0 -1
- package/cli/dist/commands/initNse.js +1 -2
- package/cli/dist/lib/detectProject.js +1 -2
- package/cli/dist/lib/initNseCore.js +0 -1
- package/cli/dist/lib/logger.js +0 -1
- package/cli/dist/lib/patchPodfile.js +0 -1
- package/cli/dist/lib/patchXcodeProject.js +22 -3
- package/cli/dist/lib/writeTemplates.js +0 -1
- package/cli/dist/lib/xcode.js +6 -0
- package/cli/dist/templates/NotificationService.swift.tmpl +74 -6
- package/cli/package.json +1 -0
- package/cli/vendor/xcode/AUTHORS +6 -0
- package/cli/vendor/xcode/LICENSE +202 -0
- package/cli/vendor/xcode/NOTICE +5 -0
- package/cli/vendor/xcode/README.md +32 -0
- package/cli/vendor/xcode/UPSTREAM-SHA256.json +12 -0
- package/cli/vendor/xcode/index.js +18 -0
- package/cli/vendor/xcode/lib/parseJob.js +32 -0
- package/cli/vendor/xcode/lib/parser/pbxproj.js +1904 -0
- package/cli/vendor/xcode/lib/parser/pbxproj.pegjs +280 -0
- package/cli/vendor/xcode/lib/pbxFile.js +233 -0
- package/cli/vendor/xcode/lib/pbxProject.js +2205 -0
- package/cli/vendor/xcode/lib/pbxWriter.js +309 -0
- package/dist/NotifeeNativeModule.web.d.ts +2 -2
- package/dist/types/Module.d.ts +10 -3
- package/dist/types/Notification.d.ts +12 -1
- package/dist/types/Notification.js +3 -0
- package/dist/types/Notification.js.map +1 -1
- package/dist/types/NotificationAndroid.d.ts +9 -0
- package/dist/types/NotificationAndroid.js.map +1 -1
- package/dist/validators/validateAndroidNotification.js +26 -1
- package/dist/validators/validateAndroidNotification.js.map +1 -1
- package/dist/validators/validateAndroidStyle.js +6 -0
- package/dist/validators/validateAndroidStyle.js.map +1 -1
- package/dist/validators/validateIOSAttachment.js +3 -1
- package/dist/validators/validateIOSAttachment.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -5
- package/src/NotifeeNativeModule.web.ts +2 -2
- package/src/types/Module.ts +10 -3
- package/src/types/Notification.ts +13 -0
- package/src/types/NotificationAndroid.ts +10 -0
- package/src/validators/validateAndroidNotification.ts +31 -1
- package/src/validators/validateAndroidStyle.ts +10 -2
- package/src/validators/validateIOSAttachment.ts +5 -1
- package/src/version.ts +1 -1
- package/cli/dist/cli.bundle.js +0 -20834
- package/cli/dist/cli.d.ts +0 -2
- package/cli/dist/cli.js.map +0 -1
- package/cli/dist/commands/initNse.d.ts +0 -12
- package/cli/dist/commands/initNse.js.map +0 -1
- package/cli/dist/lib/detectProject.d.ts +0 -12
- package/cli/dist/lib/detectProject.js.map +0 -1
- package/cli/dist/lib/initNseCore.d.ts +0 -8
- package/cli/dist/lib/initNseCore.js.map +0 -1
- package/cli/dist/lib/logger.d.ts +0 -4
- package/cli/dist/lib/logger.js.map +0 -1
- package/cli/dist/lib/patchPodfile.d.ts +0 -23
- package/cli/dist/lib/patchPodfile.js.map +0 -1
- package/cli/dist/lib/patchXcodeProject.d.ts +0 -41
- package/cli/dist/lib/patchXcodeProject.js.map +0 -1
- package/cli/dist/lib/writeTemplates.d.ts +0 -11
- package/cli/dist/lib/writeTemplates.js.map +0 -1
- package/cli/dist/templates/templates/Info.plist.tmpl +0 -29
- package/cli/dist/templates/templates/NotificationService.swift.tmpl +0 -100
- package/cli/dist/templates/templates/NotifyKitNSE.entitlements.tmpl +0 -6
|
@@ -119,7 +119,7 @@ public class ForegroundServiceTest {
|
|
|
119
119
|
|
|
120
120
|
@Test
|
|
121
121
|
@Config(
|
|
122
|
-
sdk = {34, 35},
|
|
122
|
+
sdk = {34, 35, 37},
|
|
123
123
|
shadows = SliceAShadowService.class)
|
|
124
124
|
public void sliceA_demotionPrecedesDestructiveRetirementAndEventWork() throws Exception {
|
|
125
125
|
ForegroundService service = sliceAService(ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC);
|
|
@@ -221,7 +221,9 @@ public class ForegroundServiceTest {
|
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
@Test
|
|
224
|
-
@Config(
|
|
224
|
+
@Config(
|
|
225
|
+
sdk = {35, 37},
|
|
226
|
+
shadows = SliceAShadowService.class)
|
|
225
227
|
public void sliceA_reservedUnknownAndAcceptedUndeliveredStartsRemainHeld() throws Exception {
|
|
226
228
|
ForegroundService service = sliceAService(ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC);
|
|
227
229
|
RecordingServiceContext context = useRecordingContext();
|
|
@@ -338,7 +340,9 @@ public class ForegroundServiceTest {
|
|
|
338
340
|
}
|
|
339
341
|
|
|
340
342
|
@Test
|
|
341
|
-
@Config(
|
|
343
|
+
@Config(
|
|
344
|
+
sdk = {35, 37},
|
|
345
|
+
shadows = SliceAShadowService.class)
|
|
342
346
|
public void sliceA_demotionThrowPreservesEvidenceAndPrimaryEvenWhenStopThrows() throws Exception {
|
|
343
347
|
ForegroundService service = sliceAService(ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC);
|
|
344
348
|
Object runner = issue81Field(service, "mRunnerToken");
|
|
@@ -1047,7 +1051,8 @@ public class ForegroundServiceTest {
|
|
|
1047
1051
|
}
|
|
1048
1052
|
|
|
1049
1053
|
@Implementation
|
|
1050
|
-
protected void startForeground(int id, Notification notification, int foregroundServiceType)
|
|
1054
|
+
protected void startForeground(int id, Notification notification, int foregroundServiceType)
|
|
1055
|
+
throws Exception {
|
|
1051
1056
|
if (promotionFailure != null) throw promotionFailure;
|
|
1052
1057
|
promotions++;
|
|
1053
1058
|
foreground = true;
|
|
@@ -1272,7 +1277,9 @@ public class ForegroundServiceTest {
|
|
|
1272
1277
|
}
|
|
1273
1278
|
|
|
1274
1279
|
@Test
|
|
1275
|
-
@Config(
|
|
1280
|
+
@Config(
|
|
1281
|
+
sdk = {35, 37},
|
|
1282
|
+
shadows = Issue81ShadowService.class)
|
|
1276
1283
|
public void issue82_pendingB_definiteRejectionReevaluatesRecovery_unknownDoesNot()
|
|
1277
1284
|
throws Exception {
|
|
1278
1285
|
for (RuntimeException reply :
|
|
@@ -1824,7 +1831,7 @@ public class ForegroundServiceTest {
|
|
|
1824
1831
|
|
|
1825
1832
|
@Test
|
|
1826
1833
|
@Config(
|
|
1827
|
-
sdk = {31, 33, 34, 35},
|
|
1834
|
+
sdk = {31, 33, 34, 35, 37},
|
|
1828
1835
|
shadows = Issue81ShadowService.class)
|
|
1829
1836
|
public void issue81_retryFreshDenied_recoversWithoutClaimingPromotion() throws Exception {
|
|
1830
1837
|
issue81AssertFreshRecovery(Service.START_FLAG_RETRY);
|
|
@@ -2030,7 +2037,9 @@ public class ForegroundServiceTest {
|
|
|
2030
2037
|
}
|
|
2031
2038
|
|
|
2032
2039
|
@Test
|
|
2033
|
-
@Config(
|
|
2040
|
+
@Config(
|
|
2041
|
+
sdk = {33, 37},
|
|
2042
|
+
shadows = Issue81ShadowService.class)
|
|
2034
2043
|
public void issue81_deniedA_withQueuedStop_promotesBBeforeStopping() throws Exception {
|
|
2035
2044
|
RecordingServiceContext context = useRecordingContext();
|
|
2036
2045
|
ForegroundService service = issue81Service();
|
|
@@ -2371,7 +2380,7 @@ public class ForegroundServiceTest {
|
|
|
2371
2380
|
|
|
2372
2381
|
@Test
|
|
2373
2382
|
@Config(
|
|
2374
|
-
sdk = {31, 34},
|
|
2383
|
+
sdk = {31, 34, 37},
|
|
2375
2384
|
shadows = Issue81ShadowService.class)
|
|
2376
2385
|
public void issue81_deferredRecovery_lateSecurityRejection_stops() throws Exception {
|
|
2377
2386
|
issue81AssertLateRejection(new SecurityException("B rejected"));
|
|
@@ -3105,7 +3114,7 @@ public class ForegroundServiceTest {
|
|
|
3105
3114
|
}
|
|
3106
3115
|
|
|
3107
3116
|
@Implementation
|
|
3108
|
-
protected void startForeground(int id, Notification notification) {
|
|
3117
|
+
protected void startForeground(int id, Notification notification) throws Exception {
|
|
3109
3118
|
if (!forwardingTyped) {
|
|
3110
3119
|
recordPromotion(id, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_NONE);
|
|
3111
3120
|
}
|
|
@@ -3113,7 +3122,7 @@ public class ForegroundServiceTest {
|
|
|
3113
3122
|
}
|
|
3114
3123
|
|
|
3115
3124
|
@Implementation
|
|
3116
|
-
protected void startForeground(int id, Notification notification, int type) {
|
|
3125
|
+
protected void startForeground(int id, Notification notification, int type) throws Exception {
|
|
3117
3126
|
recordPromotion(id, notification, type);
|
|
3118
3127
|
// ShadowService's typed overload delegates to the two-argument shadow. Record only the
|
|
3119
3128
|
// actual platform invocation so the witness cannot count that delegation as a second call.
|
|
@@ -4180,7 +4189,7 @@ public class ForegroundServiceTest {
|
|
|
4180
4189
|
@Implements(Service.class)
|
|
4181
4190
|
public static class DenyOldNotificationShadowService extends ShadowService {
|
|
4182
4191
|
@Implementation
|
|
4183
|
-
protected void startForeground(int id, Notification notification) {
|
|
4192
|
+
protected void startForeground(int id, Notification notification) throws Exception {
|
|
4184
4193
|
if ("B".equals(notification.extras.getString(Notification.EXTRA_TITLE))) {
|
|
4185
4194
|
throw new ForegroundServiceStartNotAllowedException("real old START denied");
|
|
4186
4195
|
}
|
|
@@ -5274,7 +5283,7 @@ public class ForegroundServiceTest {
|
|
|
5274
5283
|
@Implements(Service.class)
|
|
5275
5284
|
public static class RejectBStartForegroundShadowService extends ShadowService {
|
|
5276
5285
|
@Implementation
|
|
5277
|
-
protected void startForeground(int id, Notification notification) {
|
|
5286
|
+
protected void startForeground(int id, Notification notification) throws Exception {
|
|
5278
5287
|
if ("B".equals(notification.extras.getString(Notification.EXTRA_TITLE))) {
|
|
5279
5288
|
throw new SecurityException("posting B rejected");
|
|
5280
5289
|
}
|
|
@@ -5282,7 +5291,8 @@ public class ForegroundServiceTest {
|
|
|
5282
5291
|
}
|
|
5283
5292
|
|
|
5284
5293
|
@Implementation
|
|
5285
|
-
protected void startForeground(int id, Notification notification, int foregroundServiceType)
|
|
5294
|
+
protected void startForeground(int id, Notification notification, int foregroundServiceType)
|
|
5295
|
+
throws Exception {
|
|
5286
5296
|
if ("B".equals(notification.extras.getString(Notification.EXTRA_TITLE))) {
|
|
5287
5297
|
throw new SecurityException("posting B rejected");
|
|
5288
5298
|
}
|