expo-notifications 0.32.0 → 0.32.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/android/build.gradle +2 -2
  3. package/build/getDevicePushTokenAsync.web.js.map +1 -1
  4. package/expo-module.config.json +1 -1
  5. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.module → 0.32.1/expo.modules.notifications-0.32.1.module} +7 -7
  6. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.1/expo.modules.notifications-0.32.1.module.md5 +1 -0
  7. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.1/expo.modules.notifications-0.32.1.module.sha1 +1 -0
  8. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.1/expo.modules.notifications-0.32.1.module.sha256 +1 -0
  9. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.1/expo.modules.notifications-0.32.1.module.sha512 +1 -0
  10. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.pom → 0.32.1/expo.modules.notifications-0.32.1.pom} +1 -1
  11. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.1/expo.modules.notifications-0.32.1.pom.md5 +1 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.1/expo.modules.notifications-0.32.1.pom.sha1 +1 -0
  13. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.1/expo.modules.notifications-0.32.1.pom.sha256 +1 -0
  14. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.1/expo.modules.notifications-0.32.1.pom.sha512 +1 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml +4 -4
  16. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.md5 +1 -1
  17. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha1 +1 -1
  18. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha256 +1 -1
  19. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha512 +1 -1
  20. package/package.json +6 -6
  21. package/src/getDevicePushTokenAsync.web.ts +1 -1
  22. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.module.md5 +0 -1
  23. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.module.sha1 +0 -1
  24. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.module.sha256 +0 -1
  25. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.module.sha512 +0 -1
  26. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.pom.md5 +0 -1
  27. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.pom.sha1 +0 -1
  28. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.pom.sha256 +0 -1
  29. package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.pom.sha512 +0 -1
  30. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0-sources.jar → 0.32.1/expo.modules.notifications-0.32.1-sources.jar} +0 -0
  31. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0-sources.jar.md5 → 0.32.1/expo.modules.notifications-0.32.1-sources.jar.md5} +0 -0
  32. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0-sources.jar.sha1 → 0.32.1/expo.modules.notifications-0.32.1-sources.jar.sha1} +0 -0
  33. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0-sources.jar.sha256 → 0.32.1/expo.modules.notifications-0.32.1-sources.jar.sha256} +0 -0
  34. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0-sources.jar.sha512 → 0.32.1/expo.modules.notifications-0.32.1-sources.jar.sha512} +0 -0
  35. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.aar → 0.32.1/expo.modules.notifications-0.32.1.aar} +0 -0
  36. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.aar.md5 → 0.32.1/expo.modules.notifications-0.32.1.aar.md5} +0 -0
  37. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.aar.sha1 → 0.32.1/expo.modules.notifications-0.32.1.aar.sha1} +0 -0
  38. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.aar.sha256 → 0.32.1/expo.modules.notifications-0.32.1.aar.sha256} +0 -0
  39. /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.aar.sha512 → 0.32.1/expo.modules.notifications-0.32.1.aar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.32.1 — 2025-08-15
14
+
15
+ ### 💡 Others
16
+
17
+ - Update typings for `typescript@5.9` ([#38833](https://github.com/expo/expo/pull/38833) by [@kitten](https://github.com/kitten))
18
+
13
19
  ## 0.32.0 — 2025-08-13
14
20
 
15
21
  ### 🛠 Breaking changes
@@ -5,13 +5,13 @@ plugins {
5
5
  }
6
6
 
7
7
  group = 'host.exp.exponent'
8
- version = '0.32.0'
8
+ version = '0.32.1'
9
9
 
10
10
  android {
11
11
  namespace "expo.modules.notifications"
12
12
  defaultConfig {
13
13
  versionCode 21
14
- versionName '0.32.0'
14
+ versionName '0.32.1'
15
15
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16
16
  }
17
17
 
@@ -1 +1 @@
1
- {"version":3,"file":"getDevicePushTokenAsync.web.js","sourceRoot":"","sources":["../src/getDevicePushTokenAsync.web.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAIlD,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,uBAAuB;IACnD,MAAM,IAAI,GAAG,MAAM,wCAAwC,EAAE,CAAC;IAC9D,kBAAkB,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACxE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC;AACrC,CAAC;AAED,SAAS,eAAe;IACtB,IAAI,CAAC,CAAC,cAAc,IAAI,MAAM,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,UAAU,CAClB,iBAAiB,EACjB,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;QAC7B,MAAM,IAAI,UAAU,CAClB,iBAAiB,EACjB,mKAAmK,CACpK,CAAC;IACJ,CAAC;IACD,IAAI,YAAY,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAC1C,MAAM,IAAI,UAAU,CAClB,qCAAqC,EACrC,wGAAwG,CACzG,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,wCAAwC;IACrD,4CAA4C;IAC5C,MAAM,cAAc,GAAkB,SAAS,CAAC,UAAU,EAAE,YAAY,EAAE,cAAc,CAAC;IACzF,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MA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ourcesContent":["import Constants from 'expo-constants';\nimport { CodedError, Platform } from 'expo-modules-core';\nimport { DeviceEventEmitter } from 'react-native';\n\nimport { DevicePushToken } from './Tokens.types';\n\nexport default async function getDevicePushTokenAsync(): Promise<DevicePushToken> {\n const data = await _subscribeDeviceToPushNotificationsAsync();\n DeviceEventEmitter.emit('onDevicePushToken', { devicePushToken: data });\n return { type: Platform.OS, data };\n}\n\nfunction guardPermission() {\n if (!('Notification' in window)) {\n throw new CodedError(\n 'ERR_UNAVAILABLE',\n 'The Web Notifications API is not available on this device.'\n );\n }\n if (!navigator.serviceWorker) {\n throw new CodedError(\n 'ERR_UNAVAILABLE',\n 'Notifications cannot be used because the service worker API is not supported on this device. This might also happen because your web page does not support HTTPS.'\n );\n }\n if (Notification.permission !== 'granted') {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PERMISSION_DENIED',\n `Cannot use web notifications without permissions granted. Request permissions with \"expo-permissions\".`\n );\n }\n}\n\nasync function _subscribeDeviceToPushNotificationsAsync(): Promise<DevicePushToken['data']> {\n // @ts-expect-error: TODO: not on the schema\n const vapidPublicKey: string | null = Constants.expoConfig?.notification?.vapidPublicKey;\n if (!vapidPublicKey) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PUSH_WEB_MISSING_CONFIG',\n 'You must provide `notification.vapidPublicKey` in `app.json` to use push notifications on web. Learn more: https://docs.expo.dev/versions/latest/guides/using-vapid/.'\n );\n }\n\n // @ts-expect-error: TODO: not on the schema\n const serviceWorkerPath = Constants.expoConfig?.notification?.serviceWorkerPath;\n if (!serviceWorkerPath) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PUSH_MISSING_CONFIGURATION',\n 'You must specify `notification.serviceWorkerPath` in `app.json` to use push notifications on the web. Provide the path to the service worker that will handle notifications.'\n );\n }\n guardPermission();\n\n let registration: ServiceWorkerRegistration | null = null;\n try {\n registration = await navigator.serviceWorker.register(serviceWorkerPath);\n } catch (error) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PUSH_REGISTRATION_FAILED',\n `Could not register this device for push notifications because the service worker (${serviceWorkerPath}) could not be registered: ${error}`\n );\n }\n await navigator.serviceWorker.ready;\n\n if (!registration.active) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PUSH_REGISTRATION_FAILED',\n 'Could not register this device for push notifications because the service worker is not active.'\n );\n }\n\n const subscribeOptions = {\n userVisibleOnly: true,\n applicationServerKey: _urlBase64ToUint8Array(vapidPublicKey),\n };\n let pushSubscription: PushSubscription | null = null;\n try {\n pushSubscription = await registration.pushManager.subscribe(subscribeOptions);\n } catch (error) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PUSH_REGISTRATION_FAILED',\n 'The device was unable to register for remote notifications with the browser endpoint. (' +\n error +\n ')'\n );\n }\n const pushSubscriptionJson = pushSubscription.toJSON();\n\n const subscriptionObject = {\n endpoint: pushSubscriptionJson.endpoint,\n keys: {\n p256dh: pushSubscriptionJson.keys!.p256dh,\n auth: pushSubscriptionJson.keys!.auth,\n },\n };\n\n // Store notification icon string in service worker.\n // This message is received by `/expo-service-worker.js`.\n // We wrap it with `fromExpoWebClient` to make sure other message\n // will not override content such as `notificationIcon`.\n // https://stackoverflow.com/a/35729334/2603230\n const notificationIcon = (Constants.expoConfig?.notification ?? {}).icon;\n await registration.active.postMessage(\n JSON.stringify({ fromExpoWebClient: { notificationIcon } })\n );\n\n return subscriptionObject;\n}\n\n// https://github.com/web-push-libs/web-push#using-vapid-key-for-applicationserverkey\nfunction _urlBase64ToUint8Array(base64String: string): Uint8Array {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}\n"]}
1
+ {"version":3,"file":"getDevicePushTokenAsync.web.js","sourceRoot":"","sources":["../src/getDevicePushT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AoD;IACpD,yDAAyD;IACzD,iEAAiE;IACjE,wDAAwD;IACxD,+CAA+C;IAC/C,MAAM,gBAAgB,GAAG,CAAC,SAAS,CAAC,UAAU,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;IACzE,MAAM,YAAY,CAAC,MAAM,CAAC,WAAW,CACnC,IAAI,CAAC,SAAS,CAAC,EAAE,iBAAiB,EAAE,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAC5D,CAAC;IAEF,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,qFAAqF;AACrF,SAAS,sBAAsB,CAAC,YAAoB;IAClD,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,CAAC,YAAY,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAE9E,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,WAAW,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QACxC,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import Constants from 'expo-constants';\nimport { CodedError, Platform } from 'expo-modules-core';\nimport { DeviceEventEmitter } from 'react-native';\n\nimport { DevicePushToken } from './Tokens.types';\n\nexport default async function getDevicePushTokenAsync(): Promise<DevicePushToken> {\n const data = await _subscribeDeviceToPushNotificationsAsync();\n DeviceEventEmitter.emit('onDevicePushToken', { devicePushToken: data });\n return { type: Platform.OS, data };\n}\n\nfunction guardPermission() {\n if (!('Notification' in window)) {\n throw new CodedError(\n 'ERR_UNAVAILABLE',\n 'The Web Notifications API is not available on this device.'\n );\n }\n if (!navigator.serviceWorker) {\n throw new CodedError(\n 'ERR_UNAVAILABLE',\n 'Notifications cannot be used because the service worker API is not supported on this device. This might also happen because your web page does not support HTTPS.'\n );\n }\n if (Notification.permission !== 'granted') {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PERMISSION_DENIED',\n `Cannot use web notifications without permissions granted. Request permissions with \"expo-permissions\".`\n );\n }\n}\n\nasync function _subscribeDeviceToPushNotificationsAsync(): Promise<DevicePushToken['data']> {\n // @ts-expect-error: TODO: not on the schema\n const vapidPublicKey: string | null = Constants.expoConfig?.notification?.vapidPublicKey;\n if (!vapidPublicKey) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PUSH_WEB_MISSING_CONFIG',\n 'You must provide `notification.vapidPublicKey` in `app.json` to use push notifications on web. Learn more: https://docs.expo.dev/versions/latest/guides/using-vapid/.'\n );\n }\n\n // @ts-expect-error: TODO: not on the schema\n const serviceWorkerPath = Constants.expoConfig?.notification?.serviceWorkerPath;\n if (!serviceWorkerPath) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PUSH_MISSING_CONFIGURATION',\n 'You must specify `notification.serviceWorkerPath` in `app.json` to use push notifications on the web. Provide the path to the service worker that will handle notifications.'\n );\n }\n guardPermission();\n\n let registration: ServiceWorkerRegistration | null = null;\n try {\n registration = await navigator.serviceWorker.register(serviceWorkerPath);\n } catch (error) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PUSH_REGISTRATION_FAILED',\n `Could not register this device for push notifications because the service worker (${serviceWorkerPath}) could not be registered: ${error}`\n );\n }\n await navigator.serviceWorker.ready;\n\n if (!registration.active) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PUSH_REGISTRATION_FAILED',\n 'Could not register this device for push notifications because the service worker is not active.'\n );\n }\n\n const subscribeOptions = {\n userVisibleOnly: true,\n applicationServerKey: _urlBase64ToUint8Array(vapidPublicKey),\n };\n let pushSubscription: PushSubscription | null = null;\n try {\n pushSubscription = await registration.pushManager.subscribe(subscribeOptions);\n } catch (error) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_PUSH_REGISTRATION_FAILED',\n 'The device was unable to register for remote notifications with the browser endpoint. (' +\n error +\n ')'\n );\n }\n const pushSubscriptionJson = pushSubscription.toJSON();\n\n const subscriptionObject = {\n endpoint: pushSubscriptionJson.endpoint,\n keys: {\n p256dh: pushSubscriptionJson.keys!.p256dh,\n auth: pushSubscriptionJson.keys!.auth,\n },\n };\n\n // Store notification icon string in service worker.\n // This message is received by `/expo-service-worker.js`.\n // We wrap it with `fromExpoWebClient` to make sure other message\n // will not override content such as `notificationIcon`.\n // https://stackoverflow.com/a/35729334/2603230\n const notificationIcon = (Constants.expoConfig?.notification ?? {}).icon;\n await registration.active.postMessage(\n JSON.stringify({ fromExpoWebClient: { notificationIcon } })\n );\n\n return subscriptionObject;\n}\n\n// https://github.com/web-push-libs/web-push#using-vapid-key-for-applicationserverkey\nfunction _urlBase64ToUint8Array(base64String: string): Uint8Array<ArrayBuffer> {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}\n"]}
@@ -33,7 +33,7 @@
33
33
  "publication": {
34
34
  "groupId": "host.exp.exponent",
35
35
  "artifactId": "expo.modules.notifications",
36
- "version": "0.32.0",
36
+ "version": "0.32.1",
37
37
  "repository": "local-maven-repo"
38
38
  }
39
39
  }
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.notifications",
6
- "version": "0.32.0",
6
+ "version": "0.32.1",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.notifications-0.32.0.aar",
28
- "url": "expo.modules.notifications-0.32.0.aar",
27
+ "name": "expo.modules.notifications-0.32.1.aar",
28
+ "url": "expo.modules.notifications-0.32.1.aar",
29
29
  "size": 384693,
30
30
  "sha512": "f9cde8d4f0a7f5cbe218c7115445766eec980e044a90562cbbf524c51a5e1ac0a007bb426e95c2c6ecb30da2c5e94d963e948a84693a8c961a38f60ec8f8b8a4",
31
31
  "sha256": "54d880284e4c05bb815de98bc48ff6206e5f6ed87e79308ad90196bd2a5d105c",
@@ -122,8 +122,8 @@
122
122
  ],
123
123
  "files": [
124
124
  {
125
- "name": "expo.modules.notifications-0.32.0.aar",
126
- "url": "expo.modules.notifications-0.32.0.aar",
125
+ "name": "expo.modules.notifications-0.32.1.aar",
126
+ "url": "expo.modules.notifications-0.32.1.aar",
127
127
  "size": 384693,
128
128
  "sha512": "f9cde8d4f0a7f5cbe218c7115445766eec980e044a90562cbbf524c51a5e1ac0a007bb426e95c2c6ecb30da2c5e94d963e948a84693a8c961a38f60ec8f8b8a4",
129
129
  "sha256": "54d880284e4c05bb815de98bc48ff6206e5f6ed87e79308ad90196bd2a5d105c",
@@ -142,8 +142,8 @@
142
142
  },
143
143
  "files": [
144
144
  {
145
- "name": "expo.modules.notifications-0.32.0-sources.jar",
146
- "url": "expo.modules.notifications-0.32.0-sources.jar",
145
+ "name": "expo.modules.notifications-0.32.1-sources.jar",
146
+ "url": "expo.modules.notifications-0.32.1-sources.jar",
147
147
  "size": 99407,
148
148
  "sha512": "ad96d4d7ea7b0cecbdea1ce64b28e4dbf5267074af9d7d352bd9f866d67cc32310347a9e68712e8502b55a815890002007a154ca508c0451a61acee82865eb9e",
149
149
  "sha256": "3d445a8ee9d150d620fafe8a452c8c74427a5d835ab1263cec7d4f0743ac8f3d",
@@ -0,0 +1 @@
1
+ 2c0728944c38995262cc1d2221564a1528d7cba02bec8ea92ca80d59834f0c96
@@ -0,0 +1 @@
1
+ 85e42d78170354e7fd462d5d866da07734bf6e7a108c86b32d59fd43bcb377fffe660606a539b11ec9312a36ab7b35d58a164fdd039df413bfba239489eee274
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.notifications</artifactId>
12
- <version>0.32.0</version>
12
+ <version>0.32.1</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.notifications</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ 0aa8cbab9f7c498e001ddcbcd4d1ce3901ba3cf6de932fcc768f9d07924b8717
@@ -0,0 +1 @@
1
+ 5eb8f2c31924f121fd8346bebc6c3a351c58ec5324b64ac3c2c4e186c6865c3eabbfaacb41fc0e59b3d1392401e008c385a9970444ea7f057393980da0a70295
@@ -3,11 +3,11 @@
3
3
  <groupId>host.exp.exponent</groupId>
4
4
  <artifactId>expo.modules.notifications</artifactId>
5
5
  <versioning>
6
- <latest>0.32.0</latest>
7
- <release>0.32.0</release>
6
+ <latest>0.32.1</latest>
7
+ <release>0.32.1</release>
8
8
  <versions>
9
- <version>0.32.0</version>
9
+ <version>0.32.1</version>
10
10
  </versions>
11
- <lastUpdated>20250813165922</lastUpdated>
11
+ <lastUpdated>20250815180456</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 7818fdb161ec696b44a163f14e9d7339
1
+ 01c92c780d9c2f3e703c025e2d3129a8
@@ -1 +1 @@
1
- b74e2d324082034dd1eb0fa5b5816d6a55b14711
1
+ 34ec27c8f369d149c87fe9bbf69513b5e99b13d7
@@ -1 +1 @@
1
- 200aa5c65546f1b2746269d4fa9dfb2b63ace7385f5dce14fea1b3156f09a373
1
+ c241d54ca8367f7a64e52ab52be86a05f806fc591f33fc1b737fba0a2f1f100c
@@ -1 +1 @@
1
- 3c6ca3a2ef0db9662fb5e3782b54959a18dd8b461572c36dda20d50474394dbe3998460c04343b32c96589ee3079743cb76f86d11911c5a8bfc51c942cb28198
1
+ 67148bd4eeacc31de9dea6b1ca0833b763e13e39016ddc9429dc68a8bd3ee51bc1bbb7075cb67562d787b0b5afaaf99c4dbdc18bf8e0bf26a6ca4b5254b63d38
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-notifications",
3
- "version": "0.32.0",
3
+ "version": "0.32.1",
4
4
  "description": "Provides an API to fetch push notification tokens and to present, schedule, receive, and respond to notifications.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -42,16 +42,16 @@
42
42
  ]
43
43
  },
44
44
  "dependencies": {
45
- "@expo/image-utils": "^0.8.0",
45
+ "@expo/image-utils": "^0.8.1",
46
46
  "@ide/backoff": "^1.0.0",
47
47
  "abort-controller": "^3.0.0",
48
48
  "assert": "^2.0.0",
49
49
  "badgin": "^1.1.5",
50
- "expo-application": "~7.0.0",
51
- "expo-constants": "~18.0.0"
50
+ "expo-application": "~7.0.1",
51
+ "expo-constants": "~18.0.1"
52
52
  },
53
53
  "devDependencies": {
54
- "expo-module-scripts": "^5.0.0",
54
+ "expo-module-scripts": "^5.0.1",
55
55
  "memfs": "^3.2.0"
56
56
  },
57
57
  "peerDependencies": {
@@ -59,5 +59,5 @@
59
59
  "react": "*",
60
60
  "react-native": "*"
61
61
  },
62
- "gitHead": "cb7062e2c17d1fb09522834aaaac0e19b766df62"
62
+ "gitHead": "2f7f90d0736af48cb542ccbc8addb836e330693a"
63
63
  }
@@ -108,7 +108,7 @@ async function _subscribeDeviceToPushNotificationsAsync(): Promise<DevicePushTok
108
108
  }
109
109
 
110
110
  // https://github.com/web-push-libs/web-push#using-vapid-key-for-applicationserverkey
111
- function _urlBase64ToUint8Array(base64String: string): Uint8Array {
111
+ function _urlBase64ToUint8Array(base64String: string): Uint8Array<ArrayBuffer> {
112
112
  const padding = '='.repeat((4 - (base64String.length % 4)) % 4);
113
113
  const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/');
114
114
 
@@ -1 +0,0 @@
1
- d2219320e1baf70e37b040db107236a20eb4dae36e1dea8de6778662b8287cd5
@@ -1 +0,0 @@
1
- 35444c8fc7557408997d734e448669a7cdd91d741583ad20b06ccfa5aa935e051062745a813f8312705e7037aaf8a4691e91b6421fb87f115efa29661bbd6bea
@@ -1 +0,0 @@
1
- f43ca9def15863956205b540376904ef20cc0317ed408b6925d4bcd203d37252
@@ -1 +0,0 @@
1
- 8b39f1b6b1a245fa05510947468f5adffa40c0835f8ac13208ddcc6de9716d14c5d0624b61d728620906f5d4fc67569b2d5e6c888ee5f2a036b4a8d9b526061d