react-native-notify-kit 10.2.0 → 10.2.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.
@@ -111,8 +111,7 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
111
111
 
112
112
  + (NSString *)rollingPublicIdForRequest:(UNNotificationRequest *)request {
113
113
  NSString *identifier = request.identifier;
114
- NSString *mappedPublicId =
115
- [NotifeeCoreUtil rollingPublicIdFromInternalNotificationId:identifier];
114
+ NSString *mappedPublicId = [NotifeeCoreUtil rollingPublicIdFromInternalNotificationId:identifier];
116
115
  if ([mappedPublicId isKindOfClass:NSString.class] && [mappedPublicId length] > 0) {
117
116
  return mappedPublicId;
118
117
  }
@@ -155,11 +154,10 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
155
154
  }
156
155
  }
157
156
 
158
- + (NSMutableOrderedSet<NSString *> *)rollingIdentifiersForPublicId:(NSString *)publicId
159
- pendingRequests:
160
- (NSArray<UNNotificationRequest *> *)
161
- pendingRequests
162
- record:(NSDictionary *)record {
157
+ + (NSMutableOrderedSet<NSString *> *)
158
+ rollingIdentifiersForPublicId:(NSString *)publicId
159
+ pendingRequests:(NSArray<UNNotificationRequest *> *)pendingRequests
160
+ record:(NSDictionary *)record {
163
161
  NSMutableOrderedSet<NSString *> *identifiers = [NSMutableOrderedSet orderedSet];
164
162
 
165
163
  NSArray *scheduledIds = record[@"scheduledIds"];
@@ -186,12 +184,10 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
186
184
  return identifiers;
187
185
  }
188
186
 
189
- + (NSMutableOrderedSet<NSString *> *)rollingDeliveredIdentifiersForPublicId:
190
- (NSString *)publicId
191
- deliveredNotifications:
192
- (NSArray<UNNotification *> *)
193
- deliveredNotifications
194
- record:(NSDictionary *)record {
187
+ + (NSMutableOrderedSet<NSString *> *)
188
+ rollingDeliveredIdentifiersForPublicId:(NSString *)publicId
189
+ deliveredNotifications:(NSArray<UNNotification *> *)deliveredNotifications
190
+ record:(NSDictionary *)record {
195
191
  NSMutableOrderedSet<NSString *> *identifiers = [NSMutableOrderedSet orderedSet];
196
192
 
197
193
  NSArray *scheduledIds = record[@"scheduledIds"];
@@ -230,14 +226,12 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
230
226
  return count;
231
227
  }
232
228
 
233
- + (UNCalendarNotificationTrigger *)rollingOneShotTriggerForOccurrenceMs:
234
- (NSNumber *)occurrenceMs {
229
+ + (UNCalendarNotificationTrigger *)rollingOneShotTriggerForOccurrenceMs:(NSNumber *)occurrenceMs {
235
230
  NSDate *date = [NSDate dateWithTimeIntervalSince1970:([occurrenceMs doubleValue] / 1000.0)];
236
- NSDateComponents *components =
237
- [[NSCalendar currentCalendar] components:NSCalendarUnitYear | NSCalendarUnitMonth |
238
- NSCalendarUnitDay | NSCalendarUnitHour |
239
- NSCalendarUnitMinute | NSCalendarUnitSecond
240
- fromDate:date];
231
+ NSDateComponents *components = [[NSCalendar currentCalendar]
232
+ components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour |
233
+ NSCalendarUnitMinute | NSCalendarUnitSecond
234
+ fromDate:date];
241
235
 
242
236
  return [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:components repeats:NO];
243
237
  }
@@ -256,11 +250,11 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
256
250
  return rollingContent;
257
251
  }
258
252
 
259
- + (UNMutableNotificationContent *)triggerNotificationContentForNotification:
260
- (NSDictionary *)notification
261
- trigger:(NSDictionary *)trigger {
253
+ + (UNMutableNotificationContent *)
254
+ triggerNotificationContentForNotification:(NSDictionary *)notification
255
+ trigger:(NSDictionary *)trigger {
262
256
  UNMutableNotificationContent *content = [self buildNotificationContent:notification
263
- withTrigger:trigger];
257
+ withTrigger:trigger];
264
258
 
265
259
  if (@available(iOS 15.0, *)) {
266
260
  if (notification[@"ios"][@"communicationInfo"] != nil) {
@@ -293,16 +287,17 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
293
287
 
294
288
  + (UNNotificationRequest *)rollingNotificationRequestForPublicId:(NSString *)publicId
295
289
  occurrenceMs:(NSNumber *)occurrenceMs
296
- content:(UNMutableNotificationContent *)content
290
+ content:
291
+ (UNMutableNotificationContent *)content
297
292
  error:(NSError **)error {
298
293
  NSString *internalId = [NotifeeCoreUtil rollingInternalNotificationIdForPublicId:publicId
299
294
  occurrenceMs:occurrenceMs];
300
295
  if (internalId == nil) {
301
296
  if (error != nil) {
302
- *error = [self
303
- rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeInvalidTrigger
304
- message:@"NotifeeCore: Failed to create rolling timestamp "
305
- @"notification identifier."];
297
+ *error =
298
+ [self rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeInvalidTrigger
299
+ message:@"NotifeeCore: Failed to create rolling timestamp "
300
+ @"notification identifier."];
306
301
  }
307
302
  return nil;
308
303
  }
@@ -343,8 +338,7 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
343
338
 
344
339
  + (NSError *)scheduleRollingNotificationRequests:(NSArray<UNNotificationRequest *> *)requests
345
340
  center:(UNUserNotificationCenter *)center
346
- successfulIdentifiers:
347
- (NSMutableSet<NSString *> *)successfulIdentifiers {
341
+ successfulIdentifiers:(NSMutableSet<NSString *> *)successfulIdentifiers {
348
342
  if ([requests count] == 0) {
349
343
  return nil;
350
344
  }
@@ -378,7 +372,7 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
378
372
  }
379
373
 
380
374
  + (BOOL)persistedRollingRecords:(NSDictionary *)persistedRecords
381
- matchUpdatedRecords:(NSDictionary *)updatedRecords {
375
+ matchUpdatedRecords:(NSDictionary *)updatedRecords {
382
376
  if ([persistedRecords count] != [updatedRecords count]) {
383
377
  return NO;
384
378
  }
@@ -394,8 +388,7 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
394
388
 
395
389
  + (NSArray<NSMutableDictionary *> *)rollingRebalanceStatesFromRecords:(NSDictionary *)records
396
390
  nowMs:(NSNumber *)nowMs
397
- requiredPublicId:
398
- (NSString *)requiredPublicId
391
+ requiredPublicId:(NSString *)requiredPublicId
399
392
  error:(NSError **)error {
400
393
  NSMutableArray<NSMutableDictionary *> *states = [NSMutableArray array];
401
394
  BOOL foundRequiredPublicId = requiredPublicId == nil;
@@ -435,10 +428,10 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
435
428
  occurrenceMs:firstOccurrenceMs];
436
429
  if (firstOccurrenceMs == nil || firstInternalId == nil) {
437
430
  if (isRequiredPublicId && error != nil) {
438
- *error = [self
439
- rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeInvalidTrigger
440
- message:@"NotifeeCore: Rolling timestamp trigger did not "
441
- @"produce any future occurrences."];
431
+ *error =
432
+ [self rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeInvalidTrigger
433
+ message:@"NotifeeCore: Rolling timestamp trigger did not "
434
+ @"produce any future occurrences."];
442
435
  return nil;
443
436
  }
444
437
  continue;
@@ -467,16 +460,15 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
467
460
  return nil;
468
461
  }
469
462
 
470
- [states sortUsingComparator:^NSComparisonResult(NSDictionary *firstState,
471
- NSDictionary *secondState) {
472
- return [self compareRollingRebalanceState:firstState otherState:secondState];
473
- }];
463
+ [states
464
+ sortUsingComparator:^NSComparisonResult(NSDictionary *firstState, NSDictionary *secondState) {
465
+ return [self compareRollingRebalanceState:firstState otherState:secondState];
466
+ }];
474
467
 
475
468
  return states;
476
469
  }
477
470
 
478
- + (BOOL)prepareRollingRebalanceDesiredSchedulesForStates:
479
- (NSArray<NSMutableDictionary *> *)states
471
+ + (BOOL)prepareRollingRebalanceDesiredSchedulesForStates:(NSArray<NSMutableDictionary *> *)states
480
472
  nowMs:(NSNumber *)nowMs
481
473
  error:(NSError **)error {
482
474
  for (NSMutableDictionary *state in states) {
@@ -489,15 +481,13 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
489
481
  NSDictionary *notification = state[@"notification"];
490
482
  NSDictionary *trigger = state[@"trigger"];
491
483
  NSArray<NSNumber *> *occurrences =
492
- [NotifeeCoreUtil rollingTimestampOccurrencesFromTrigger:trigger
493
- nowMs:nowMs
494
- maxCount:quota];
484
+ [NotifeeCoreUtil rollingTimestampOccurrencesFromTrigger:trigger nowMs:nowMs maxCount:quota];
495
485
  if ([occurrences count] == 0) {
496
486
  if (error != nil) {
497
- *error = [self
498
- rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeInvalidTrigger
499
- message:@"NotifeeCore: Rolling timestamp trigger did not "
500
- @"produce any future occurrences."];
487
+ *error =
488
+ [self rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeInvalidTrigger
489
+ message:@"NotifeeCore: Rolling timestamp trigger did not "
490
+ @"produce any future occurrences."];
501
491
  }
502
492
  return NO;
503
493
  }
@@ -515,11 +505,10 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
515
505
  }
516
506
 
517
507
  NSError *requestError = nil;
518
- UNNotificationRequest *request =
519
- [self rollingNotificationRequestForPublicId:publicId
520
- occurrenceMs:occurrenceMs
521
- content:content
522
- error:&requestError];
508
+ UNNotificationRequest *request = [self rollingNotificationRequestForPublicId:publicId
509
+ occurrenceMs:occurrenceMs
510
+ content:content
511
+ error:&requestError];
523
512
  if (request == nil) {
524
513
  if (error != nil) {
525
514
  *error = requestError;
@@ -538,10 +527,10 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
538
527
 
539
528
  if ([desiredIds count] == 0 || lastScheduledOccurrence == nil) {
540
529
  if (error != nil) {
541
- *error = [self
542
- rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeInvalidTrigger
543
- message:@"NotifeeCore: Rolling timestamp trigger did not "
544
- @"produce any future occurrences."];
530
+ *error =
531
+ [self rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeInvalidTrigger
532
+ message:@"NotifeeCore: Rolling timestamp trigger did not "
533
+ @"produce any future occurrences."];
545
534
  }
546
535
  return NO;
547
536
  }
@@ -562,10 +551,9 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
562
551
  return YES;
563
552
  }
564
553
 
565
- + (void)rollbackRollingRebalanceRemovedRequests:
566
- (NSArray<UNNotificationRequest *> *)removedRequests
567
- successfulNewIdentifiers:(NSSet<NSString *> *)successfulNewIdentifiers
568
- center:(UNUserNotificationCenter *)center {
554
+ + (void)rollbackRollingRebalanceRemovedRequests:(NSArray<UNNotificationRequest *> *)removedRequests
555
+ successfulNewIdentifiers:(NSSet<NSString *> *)successfulNewIdentifiers
556
+ center:(UNUserNotificationCenter *)center {
569
557
  if ([successfulNewIdentifiers count] > 0) {
570
558
  [self removeRollingPendingRequestsForIds:[successfulNewIdentifiers allObjects] center:center];
571
559
  }
@@ -579,18 +567,16 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
579
567
 
580
568
  + (BOOL)rebalanceRollingTimestampTriggerRecords:(NSDictionary *)records
581
569
  center:(UNUserNotificationCenter *)center
582
- pendingRequests:
583
- (NSArray<UNNotificationRequest *> *)pendingRequests
570
+ pendingRequests:(NSArray<UNNotificationRequest *> *)pendingRequests
584
571
  nowMs:(NSNumber *)nowMs
585
572
  refreshPublicId:(NSString *)refreshPublicId
586
573
  requiredPublicId:(NSString *)requiredPublicId
587
574
  error:(NSError **)error {
588
575
  NSError *stateError = nil;
589
- NSArray<NSMutableDictionary *> *states =
590
- [self rollingRebalanceStatesFromRecords:records
591
- nowMs:nowMs
592
- requiredPublicId:requiredPublicId
593
- error:&stateError];
576
+ NSArray<NSMutableDictionary *> *states = [self rollingRebalanceStatesFromRecords:records
577
+ nowMs:nowMs
578
+ requiredPublicId:requiredPublicId
579
+ error:&stateError];
594
580
  if (states == nil) {
595
581
  if (error != nil) {
596
582
  *error = stateError;
@@ -772,10 +758,10 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
772
758
  [self removeRollingPendingRequestsForIds:[successfulNewIdentifiers allObjects] center:center];
773
759
 
774
760
  if (error != nil) {
775
- *error = [self
776
- rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeStorageFailed
777
- message:@"NotifeeCore: Failed to persist rolling timestamp "
778
- @"trigger records after rebalance."];
761
+ *error =
762
+ [self rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeStorageFailed
763
+ message:@"NotifeeCore: Failed to persist rolling timestamp "
764
+ @"trigger records after rebalance."];
779
765
  }
780
766
  return NO;
781
767
  }
@@ -815,10 +801,10 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
815
801
  dispatch_async([self rollingTimestampQueue], ^{
816
802
  NSString *publicId = [self rollingPublicIdForNotification:notification];
817
803
  if (publicId == nil) {
818
- NSError *error = [self
819
- rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeInvalidTrigger
820
- message:@"NotifeeCore: Rolling timestamp trigger requires a "
821
- @"notification id."];
804
+ NSError *error =
805
+ [self rollingTimestampErrorWithCode:NotifeeCoreRollingErrorCodeInvalidTrigger
806
+ message:@"NotifeeCore: Rolling timestamp trigger requires a "
807
+ @"notification id."];
822
808
  [self resolveBlock:block withError:error];
823
809
  return;
824
810
  }
@@ -881,8 +867,8 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
881
867
  NSArray<UNNotification *> *deliveredNotifications = [self deliveredNotifications:center];
882
868
  NSMutableOrderedSet<NSString *> *deliveredIdentifiersToRemove =
883
869
  [self rollingDeliveredIdentifiersForPublicId:notificationId
884
- deliveredNotifications:deliveredNotifications
885
- record:record];
870
+ deliveredNotifications:deliveredNotifications
871
+ record:record];
886
872
  [self addString:notificationId toOrderedSet:deliveredIdentifiersToRemove];
887
873
  if ([deliveredIdentifiersToRemove count] > 0) {
888
874
  [center removeDeliveredNotificationsWithIdentifiers:[deliveredIdentifiersToRemove array]];
@@ -934,8 +920,7 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
934
920
  cancelTrigger ? [self pendingNotificationRequests:center] : @[];
935
921
  NSMutableOrderedSet<NSString *> *deliveredIdentifiersToRemove =
936
922
  [NSMutableOrderedSet orderedSet];
937
- NSMutableOrderedSet<NSString *> *pendingIdentifiersToRemove =
938
- [NSMutableOrderedSet orderedSet];
923
+ NSMutableOrderedSet<NSString *> *pendingIdentifiersToRemove = [NSMutableOrderedSet orderedSet];
939
924
 
940
925
  for (NSString *publicId in publicIds) {
941
926
  NSDictionary *record = records[publicId];
@@ -943,8 +928,8 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
943
928
  if (cancelDisplayed) {
944
929
  NSMutableOrderedSet<NSString *> *rollingDeliveredIdentifiers =
945
930
  [self rollingDeliveredIdentifiersForPublicId:publicId
946
- deliveredNotifications:deliveredNotifications
947
- record:record];
931
+ deliveredNotifications:deliveredNotifications
932
+ record:record];
948
933
  [deliveredIdentifiersToRemove unionOrderedSet:rollingDeliveredIdentifiers];
949
934
  [self addString:publicId toOrderedSet:deliveredIdentifiersToRemove];
950
935
  }
@@ -985,9 +970,7 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
985
970
  + (void)cancelNotification:(NSString *)notificationId
986
971
  withNotificationType:(NSInteger)notificationType
987
972
  withBlock:(notifeeMethodVoidBlock)block {
988
- [self cancelRollingNotification:notificationId
989
- withNotificationType:notificationType
990
- block:block];
973
+ [self cancelRollingNotification:notificationId withNotificationType:notificationType block:block];
991
974
  }
992
975
 
993
976
  /**
@@ -1047,10 +1030,8 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
1047
1030
 
1048
1031
  triggerNotification[@"date"] =
1049
1032
  [NotifeeCoreUtil convertToTimestamp:deliveredNotification.date];
1050
- triggerNotification[@"notification"] =
1051
- request.content.userInfo[kNotifeeUserInfoNotification];
1052
- triggerNotification[@"trigger"] =
1053
- request.content.userInfo[kNotifeeUserInfoTrigger];
1033
+ triggerNotification[@"notification"] = request.content.userInfo[kNotifeeUserInfoNotification];
1034
+ triggerNotification[@"trigger"] = request.content.userInfo[kNotifeeUserInfoTrigger];
1054
1035
 
1055
1036
  if (triggerNotification[@"notification"] == nil) {
1056
1037
  // parse remote notification
@@ -1139,8 +1120,7 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
1139
1120
  NSString *notificationId = request.identifier;
1140
1121
  NSString *rollingPublicId =
1141
1122
  [NotifeeCoreUtil rollingPublicIdFromInternalNotificationId:notificationId];
1142
- [self addString:(rollingPublicId != nil ? rollingPublicId : notificationId)
1143
- toOrderedSet:ids];
1123
+ [self addString:(rollingPublicId != nil ? rollingPublicId : notificationId) toOrderedSet:ids];
1144
1124
  }
1145
1125
 
1146
1126
  NSDictionary *rollingRecords = [NotifeeCoreUtil getRollingTimestampTriggers];
@@ -1202,26 +1182,33 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
1202
1182
  trigger:nil];
1203
1183
 
1204
1184
  dispatch_async(dispatch_get_main_queue(), ^{
1205
- [center
1206
- addNotificationRequest:request
1207
- withCompletionHandler:^(NSError *error) {
1208
- if (error == nil) {
1209
- // When the app is in foreground, willPresentNotification: emits
1210
- // DELIVERED for all Notifee-owned notifications. Only emit here
1211
- // when the app is NOT active to avoid duplicate events.
1212
- dispatch_async(dispatch_get_main_queue(), ^{
1213
- if (UIApplication.sharedApplication.applicationState != UIApplicationStateActive) {
1214
- [[NotifeeCoreDelegateHolder instance] didReceiveNotifeeCoreEvent:@{
1215
- @"type" : @(NotifeeCoreEventTypeDelivered),
1216
- @"detail" : @{
1217
- @"notification" : notificationDetail,
1185
+ [center addNotificationRequest:request
1186
+ withCompletionHandler:^(NSError *error) {
1187
+ if (error == nil) {
1188
+ // When the app is in foreground, willPresentNotification: emits
1189
+ // DELIVERED for all Notifee-owned notifications. Only emit here
1190
+ // when the app is NOT active to avoid duplicate events.
1191
+ dispatch_async(dispatch_get_main_queue(), ^{
1192
+ BOOL isApplicationActive = NO;
1193
+ if (![NotifeeCoreUtil isAppExtension]) {
1194
+ UIApplication *application = [NotifeeCoreUtil notifeeUIApplication];
1195
+ if (application != nil) {
1196
+ isApplicationActive =
1197
+ application.applicationState == UIApplicationStateActive;
1198
+ }
1218
1199
  }
1219
- }];
1200
+ if (!isApplicationActive) {
1201
+ [[NotifeeCoreDelegateHolder instance] didReceiveNotifeeCoreEvent:@{
1202
+ @"type" : @(NotifeeCoreEventTypeDelivered),
1203
+ @"detail" : @{
1204
+ @"notification" : notificationDetail,
1205
+ }
1206
+ }];
1207
+ }
1208
+ });
1220
1209
  }
1221
- });
1222
- }
1223
- block(error);
1224
- }];
1210
+ block(error);
1211
+ }];
1225
1212
  });
1226
1213
  });
1227
1214
  }
@@ -1236,8 +1223,8 @@ typedef NS_ENUM(NSInteger, NotifeeCoreRollingErrorCode) {
1236
1223
  withTrigger:(NSDictionary *)trigger
1237
1224
  withBlock:(notifeeMethodVoidBlock)block {
1238
1225
  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
1239
- UNMutableNotificationContent *content = [self triggerNotificationContentForNotification:notification
1240
- trigger:trigger];
1226
+ UNMutableNotificationContent *content =
1227
+ [self triggerNotificationContentForNotification:notification trigger:trigger];
1241
1228
  UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
1242
1229
 
1243
1230
  NSMutableDictionary *notificationDetail = [notification mutableCopy];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-notify-kit",
3
- "version": "10.2.0",
3
+ "version": "10.2.1",
4
4
  "author": "Marco Crupi",
5
5
  "description": "Maintained Notifee-compatible fork for React Native — advanced local notifications for Android & iOS.",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -33,3 +33,5 @@ export * from './types/NotificationIOS';
33
33
  export * from './types/NotificationAndroid';
34
34
  export * from './types/PowerManagerInfo';
35
35
  export type { FcmRemoteMessage, FcmConfig } from './fcm/types';
36
+ export type { ModuleWithStatics } from './types/Module';
37
+ export type { WebNotificationSettings } from './types/NotificationWeb';
@@ -590,9 +590,17 @@ export interface Module {
590
590
  isBatteryOptimizationEnabled(): Promise<boolean>;
591
591
 
592
592
  /**
593
- * API used to get information about the device and its power manager settings, including manufacturer, model, version and activity.
593
+ * API used to get best-effort information about the device and its power manager settings, including manufacturer, model, version and a known activity candidate.
594
594
  *
595
- * If `activity` is `null`, `openPowerManagerSettings()` will be noop.
595
+ * The returned `activity` is based on Notify Kit's manufacturer mapping and is not
596
+ * prevalidated with `PackageManager`. A non-null value does not guarantee that
597
+ * `openPowerManagerSettings()` can open that screen on the current device firmware.
598
+ *
599
+ * Notify Kit does not rely on Android 11+ package-visibility queries for this helper,
600
+ * so consumer apps do not need to add `<queries>` to use it.
601
+ *
602
+ * If `activity` is `null`, `openPowerManagerSettings()` will be a no-op because
603
+ * there is no known vendor-settings candidate.
596
604
  *
597
605
  * On iOS, an instance of `PowerManagerInfo` will be returned with `activity` set to `null`.
598
606
  *
@@ -607,7 +615,7 @@ export interface Module {
607
615
  * // 1. ask the user to adjust their Power Manager settings
608
616
  * // ...
609
617
  *
610
- * // 2. open settings
618
+ * // 2. open settings best-effort
611
619
  * await notifee.openPowerManagerSettings();
612
620
  * }
613
621
  * ```
@@ -617,9 +625,15 @@ export interface Module {
617
625
  getPowerManagerInfo(): Promise<PowerManagerInfo>;
618
626
 
619
627
  /**
620
- * API used to navigate to the appropriate Android System settings for the device.
628
+ * API used to best-effort open known Android System power manager settings for the device.
629
+ *
630
+ * Call `getPowerManagerInfo()` first to decide whether to prompt the user. A
631
+ * non-null `activity` means Notify Kit has a known vendor-settings candidate, not
632
+ * that Android has confirmed the activity exists or is accessible.
621
633
  *
622
- * Call `getPowerManagerInfo()` first to find out if the user's device is supported.
634
+ * Notify Kit does not require consumer apps to add `<queries>` for this helper. If
635
+ * Android rejects or cannot resolve a vendor settings intent, the method safely
636
+ * falls back or no-ops instead of crashing.
623
637
  *
624
638
  * View the [Background Restrictions](/react-native/android/background-restrictions) documentation for more information.
625
639
  *
@@ -632,7 +646,7 @@ export interface Module {
632
646
  * // 1. ask the user to adjust their Power Manager settings
633
647
  * // ...
634
648
  *
635
- * // 2. if yes, navigate them to settings
649
+ * // 2. if yes, try to open settings
636
650
  * await notifee.openPowerManagerSettings();
637
651
  * }
638
652
  * ```
@@ -32,12 +32,17 @@ export interface PowerManagerInfo {
32
32
  version?: string;
33
33
 
34
34
  /**
35
- * The activity that the user will be navigated to if `openPowerManagerSettings()` is called.
35
+ * The known vendor-settings activity candidate for this device manufacturer.
36
36
  *
37
- * Use this as an indicator of what steps the user may have to perform,
38
- * in-order to prevent your app from being killed.
37
+ * This value is based on Notify Kit's manufacturer mapping. It is not prevalidated
38
+ * with `PackageManager`, and it is not a guarantee that the activity is installed
39
+ * or accessible on the current device firmware.
39
40
  *
40
- * If no activity can be found, value will be null.
41
+ * Use this as a best-effort indicator of what steps the user may have to perform,
42
+ * in-order to prevent your app from being killed. `openPowerManagerSettings()`
43
+ * handles unavailable or rejected candidates safely.
44
+ *
45
+ * If no known activity candidate exists, value will be null.
41
46
  */
42
47
  activity?: string | null;
43
48
  }
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '10.2.0';
2
+ export const version = '10.2.1';