@dubsdotapp/expo 0.5.20 → 0.5.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dubsdotapp/expo",
3
- "version": "0.5.20",
3
+ "version": "0.5.22",
4
4
  "description": "React Native SDK for the Dubs betting platform",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -3,11 +3,29 @@ import { Platform } from 'react-native';
3
3
  import { useDubs } from '../provider';
4
4
 
5
5
  export interface PushNotificationStatus {
6
- /** Whether push notifications are enabled in the SDK configuration */
6
+ /**
7
+ * Whether push is currently delivering to this user — the right signal for
8
+ * UI bindings like a "Notifications: Enabled/Disabled" toggle.
9
+ *
10
+ * Equivalent to `enabled && !!pushToken`. Goes false after `unregister()`
11
+ * even though OS permission is still granted. Goes true after `register()`
12
+ * succeeds.
13
+ *
14
+ * Use this — NOT `hasPermission` — when binding switches/toggles.
15
+ */
16
+ isActive: boolean;
17
+ /** Whether push notifications are enabled in the SDK configuration (the `pushEnabled` prop on DubsProvider). */
7
18
  enabled: boolean;
8
- /** Whether notification permission has been granted */
19
+ /**
20
+ * Whether OS-level notification permission has been granted on this device.
21
+ *
22
+ * Note: this stays true after `unregister()` because the OS doesn't revoke
23
+ * permission when a server token is dropped. Useful for permission-flow
24
+ * prompts (e.g. "Re-enable in Settings" hint), but NOT for "is push on" UI —
25
+ * use `isActive` for that.
26
+ */
9
27
  hasPermission: boolean;
10
- /** The push token (native FCM/APNs), if registered */
28
+ /** The native device push token (FCM/APNs), if currently registered with the server. */
11
29
  pushToken: string | null;
12
30
  /**
13
31
  * @deprecated Use pushToken instead. Kept for backwards compatibility.
@@ -188,6 +206,7 @@ export function usePushNotifications(): PushNotificationStatus {
188
206
  }, []); // eslint-disable-line react-hooks/exhaustive-deps
189
207
 
190
208
  return {
209
+ isActive: pushEnabled && !!pushToken,
191
210
  enabled: pushEnabled,
192
211
  hasPermission,
193
212
  pushToken,