react-native-notify-kit 9.2.0 → 9.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.
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "9.2.0";
1
+ export declare const version = "9.2.1";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '9.2.0';
2
+ export const version = '9.2.1';
3
3
  //# sourceMappingURL=version.js.map
@@ -88,15 +88,33 @@ RCT_EXPORT_MODULE();
88
88
  }
89
89
 
90
90
  - (void)sendNotifeeCoreEvent:(NSDictionary *_Nonnull)eventBody {
91
- dispatch_after(
92
- dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
93
- if (RCTRunningInAppExtension() ||
94
- [UIApplication sharedApplication].applicationState == UIApplicationStateBackground) {
95
- [self sendEventWithName:kReactNativeNotifeeNotificationBackgroundEvent body:eventBody];
96
- } else {
97
- [self sendEventWithName:kReactNativeNotifeeNotificationEvent body:eventBody];
98
- }
99
- });
91
+ dispatch_async(dispatch_get_main_queue(), ^{
92
+ if (!hasListeners) {
93
+ [pendingCoreEvents addObject:eventBody];
94
+ return;
95
+ }
96
+ // Routing foreground vs background is based on UIApplication state.
97
+ // iOS delivers didReceiveNotificationResponse: while the app is in
98
+ // Inactive state during a background tap transition, not Background —
99
+ // so we check != Active rather than == Background.
100
+ //
101
+ // Known limitation: this also routes non-tap events (DELIVERED,
102
+ // TRIGGER_NOTIFICATION_CREATED, DISMISSED) to the background channel
103
+ // if they happen to be emitted while the app is in Inactive state for
104
+ // unrelated reasons (Control Center open, incoming call, etc.). In
105
+ // practice this is rare because DELIVERED originates from
106
+ // willPresentNotification: (only called when app is Active) and the
107
+ // API-triggered events require an interactive JS context. If this
108
+ // becomes a real-world problem, the routing should be split by event
109
+ // type rather than by state alone.
110
+ BOOL isBackground = RCTRunningInAppExtension() ||
111
+ [UIApplication sharedApplication].applicationState != UIApplicationStateActive;
112
+ if (isBackground) {
113
+ [self sendEventWithName:kReactNativeNotifeeNotificationBackgroundEvent body:eventBody];
114
+ } else {
115
+ [self sendEventWithName:kReactNativeNotifeeNotificationEvent body:eventBody];
116
+ }
117
+ });
100
118
  }
101
119
 
102
120
  // clang-format off
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-notify-kit",
3
- "version": "9.2.0",
3
+ "version": "9.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/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '9.2.0';
2
+ export const version = '9.2.1';