@dubsdotapp/expo 0.5.21 → 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/dist/index.d.mts CHANGED
@@ -1212,11 +1212,29 @@ interface ShortVideo {
1212
1212
  declare function useShorts(league?: string, limit?: number): QueryResult<ShortVideo[]>;
1213
1213
 
1214
1214
  interface PushNotificationStatus {
1215
- /** Whether push notifications are enabled in the SDK configuration */
1215
+ /**
1216
+ * Whether push is currently delivering to this user — the right signal for
1217
+ * UI bindings like a "Notifications: Enabled/Disabled" toggle.
1218
+ *
1219
+ * Equivalent to `enabled && !!pushToken`. Goes false after `unregister()`
1220
+ * even though OS permission is still granted. Goes true after `register()`
1221
+ * succeeds.
1222
+ *
1223
+ * Use this — NOT `hasPermission` — when binding switches/toggles.
1224
+ */
1225
+ isActive: boolean;
1226
+ /** Whether push notifications are enabled in the SDK configuration (the `pushEnabled` prop on DubsProvider). */
1216
1227
  enabled: boolean;
1217
- /** Whether notification permission has been granted */
1228
+ /**
1229
+ * Whether OS-level notification permission has been granted on this device.
1230
+ *
1231
+ * Note: this stays true after `unregister()` because the OS doesn't revoke
1232
+ * permission when a server token is dropped. Useful for permission-flow
1233
+ * prompts (e.g. "Re-enable in Settings" hint), but NOT for "is push on" UI —
1234
+ * use `isActive` for that.
1235
+ */
1218
1236
  hasPermission: boolean;
1219
- /** The push token (native FCM/APNs), if registered */
1237
+ /** The native device push token (FCM/APNs), if currently registered with the server. */
1220
1238
  pushToken: string | null;
1221
1239
  /**
1222
1240
  * @deprecated Use pushToken instead. Kept for backwards compatibility.
package/dist/index.d.ts CHANGED
@@ -1212,11 +1212,29 @@ interface ShortVideo {
1212
1212
  declare function useShorts(league?: string, limit?: number): QueryResult<ShortVideo[]>;
1213
1213
 
1214
1214
  interface PushNotificationStatus {
1215
- /** Whether push notifications are enabled in the SDK configuration */
1215
+ /**
1216
+ * Whether push is currently delivering to this user — the right signal for
1217
+ * UI bindings like a "Notifications: Enabled/Disabled" toggle.
1218
+ *
1219
+ * Equivalent to `enabled && !!pushToken`. Goes false after `unregister()`
1220
+ * even though OS permission is still granted. Goes true after `register()`
1221
+ * succeeds.
1222
+ *
1223
+ * Use this — NOT `hasPermission` — when binding switches/toggles.
1224
+ */
1225
+ isActive: boolean;
1226
+ /** Whether push notifications are enabled in the SDK configuration (the `pushEnabled` prop on DubsProvider). */
1216
1227
  enabled: boolean;
1217
- /** Whether notification permission has been granted */
1228
+ /**
1229
+ * Whether OS-level notification permission has been granted on this device.
1230
+ *
1231
+ * Note: this stays true after `unregister()` because the OS doesn't revoke
1232
+ * permission when a server token is dropped. Useful for permission-flow
1233
+ * prompts (e.g. "Re-enable in Settings" hint), but NOT for "is push on" UI —
1234
+ * use `isActive` for that.
1235
+ */
1218
1236
  hasPermission: boolean;
1219
- /** The push token (native FCM/APNs), if registered */
1237
+ /** The native device push token (FCM/APNs), if currently registered with the server. */
1220
1238
  pushToken: string | null;
1221
1239
  /**
1222
1240
  * @deprecated Use pushToken instead. Kept for backwards compatibility.
package/dist/index.js CHANGED
@@ -2830,6 +2830,7 @@ function usePushNotifications() {
2830
2830
  restoreIfGranted();
2831
2831
  }, []);
2832
2832
  return {
2833
+ isActive: pushEnabled && !!pushToken,
2833
2834
  enabled: pushEnabled,
2834
2835
  hasPermission,
2835
2836
  pushToken,