expo-notifications 0.32.0 → 0.32.2
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/CHANGELOG.md +10 -0
- package/android/build.gradle +2 -2
- package/build/getDevicePushTokenAsync.web.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.module → 0.32.2/expo.modules.notifications-0.32.2.module} +7 -7
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.2/expo.modules.notifications-0.32.2.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.2/expo.modules.notifications-0.32.2.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.2/expo.modules.notifications-0.32.2.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.2/expo.modules.notifications-0.32.2.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.pom → 0.32.2/expo.modules.notifications-0.32.2.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.2/expo.modules.notifications-0.32.2.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.2/expo.modules.notifications-0.32.2.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.2/expo.modules.notifications-0.32.2.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.2/expo.modules.notifications-0.32.2.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha512 +1 -1
- package/package.json +6 -6
- package/src/getDevicePushTokenAsync.web.ts +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.notifications/0.32.0/expo.modules.notifications-0.32.0.pom.sha512 +0 -1
- /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0-sources.jar → 0.32.2/expo.modules.notifications-0.32.2-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0-sources.jar.md5 → 0.32.2/expo.modules.notifications-0.32.2-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0-sources.jar.sha1 → 0.32.2/expo.modules.notifications-0.32.2-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0-sources.jar.sha256 → 0.32.2/expo.modules.notifications-0.32.2-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0-sources.jar.sha512 → 0.32.2/expo.modules.notifications-0.32.2-sources.jar.sha512} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.aar → 0.32.2/expo.modules.notifications-0.32.2.aar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.aar.md5 → 0.32.2/expo.modules.notifications-0.32.2.aar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.aar.sha1 → 0.32.2/expo.modules.notifications-0.32.2.aar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.aar.sha256 → 0.32.2/expo.modules.notifications-0.32.2.aar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.notifications/{0.32.0/expo.modules.notifications-0.32.0.aar.sha512 → 0.32.2/expo.modules.notifications-0.32.2.aar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.32.2 — 2025-08-16
|
|
14
|
+
|
|
15
|
+
_This version does not introduce any user-facing changes._
|
|
16
|
+
|
|
17
|
+
## 0.32.1 — 2025-08-15
|
|
18
|
+
|
|
19
|
+
### 💡 Others
|
|
20
|
+
|
|
21
|
+
- Update typings for `typescript@5.9` ([#38833](https://github.com/expo/expo/pull/38833) by [@kitten](https://github.com/kitten))
|
|
22
|
+
|
|
13
23
|
## 0.32.0 — 2025-08-13
|
|
14
24
|
|
|
15
25
|
### 🛠 Breaking changes
|
package/android/build.gradle
CHANGED
|
@@ -5,13 +5,13 @@ plugins {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
group = 'host.exp.exponent'
|
|
8
|
-
version = '0.32.
|
|
8
|
+
version = '0.32.2'
|
|
9
9
|
|
|
10
10
|
android {
|
|
11
11
|
namespace "expo.modules.notifications"
|
|
12
12
|
defaultConfig {
|
|
13
13
|
versionCode 21
|
|
14
|
-
versionName '0.32.
|
|
14
|
+
versionName '0.32.2'
|
|
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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E,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 {\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/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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C","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"]}
|
package/expo-module.config.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.notifications",
|
|
6
|
-
"version": "0.32.
|
|
6
|
+
"version": "0.32.2",
|
|
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.
|
|
28
|
-
"url": "expo.modules.notifications-0.32.
|
|
27
|
+
"name": "expo.modules.notifications-0.32.2.aar",
|
|
28
|
+
"url": "expo.modules.notifications-0.32.2.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.
|
|
126
|
-
"url": "expo.modules.notifications-0.32.
|
|
125
|
+
"name": "expo.modules.notifications-0.32.2.aar",
|
|
126
|
+
"url": "expo.modules.notifications-0.32.2.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.
|
|
146
|
-
"url": "expo.modules.notifications-0.32.
|
|
145
|
+
"name": "expo.modules.notifications-0.32.2-sources.jar",
|
|
146
|
+
"url": "expo.modules.notifications-0.32.2-sources.jar",
|
|
147
147
|
"size": 99407,
|
|
148
148
|
"sha512": "ad96d4d7ea7b0cecbdea1ce64b28e4dbf5267074af9d7d352bd9f866d67cc32310347a9e68712e8502b55a815890002007a154ca508c0451a61acee82865eb9e",
|
|
149
149
|
"sha256": "3d445a8ee9d150d620fafe8a452c8c74427a5d835ab1263cec7d4f0743ac8f3d",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
61f40a8aef464b6bee8ad3e26640ca7a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4ad017721d6067218c9c7043333ff5ae4e2d8069
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
24f07de21b0c4cf28192e1c2ddb798ea50692cd8f626247724d72d31c2f0e4bf
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0eacb6fa3294d6fd1c71aee6a70e0ffb639f24dadf826189b07c15247b5bf557f9088bb43f88f8b0cae822a626efe92a1b0abbb67a6346900e9c075cc243ab6a
|
|
@@ -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.
|
|
12
|
+
<version>0.32.2</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
|
+
4b95733b0a7b26795e4a6c820d0cfa6c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a4d3cbf54ce9c25642dd3ba68aff6db45093f049
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a2e1fb7cde29cd4fed2f69fcb47cac28a18e8e90688bce987ed23c266a5dfde8
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8da0dda72e5d4d229a54e892b91c6ada9bf96b65770d046aebbc699ac9cde7cc8d69e8f3e72ff9f1c9296bc112e48e9f3a6bc2ee5eb890653590c19707d0f623
|
|
@@ -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.
|
|
7
|
-
<release>0.32.
|
|
6
|
+
<latest>0.32.2</latest>
|
|
7
|
+
<release>0.32.2</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>0.32.
|
|
9
|
+
<version>0.32.2</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20250817001226</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.md5
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ab67a350f53a7349b0d32707135bfb1e
|
package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha1
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3510b58b79e6c7889f0333f9f143a6b347fe4117
|
package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
0900ba34a5194868f6c74ac32fa9bbc21675a5c81f540bd76acf9e7c5dcd91dc
|
package/local-maven-repo/host/exp/exponent/expo.modules.notifications/maven-metadata.xml.sha512
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5d6d1488743e46201ed7f1319bb8c8020234513c6bfd33adc45e12ed51d4366bfaa13334c017f4d98cc98a717b7724e67cddd452db4290b64e0c2bd0793cf38a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-notifications",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.2",
|
|
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.
|
|
45
|
+
"@expo/image-utils": "^0.8.2",
|
|
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.
|
|
51
|
-
"expo-constants": "~18.0.
|
|
50
|
+
"expo-application": "~7.0.2",
|
|
51
|
+
"expo-constants": "~18.0.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"expo-module-scripts": "^5.0.
|
|
54
|
+
"expo-module-scripts": "^5.0.2",
|
|
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": "
|
|
62
|
+
"gitHead": "eaa9b645058cf2233fbb27bb21a19bc605c90a88"
|
|
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
|
-
0b85b6d4b8e65766709ccf800408a048
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
69aec3c9696241c8823e669033a353e6d17df166
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d2219320e1baf70e37b040db107236a20eb4dae36e1dea8de6778662b8287cd5
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
35444c8fc7557408997d734e448669a7cdd91d741583ad20b06ccfa5aa935e051062745a813f8312705e7037aaf8a4691e91b6421fb87f115efa29661bbd6bea
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d313980365607f2e74630be423f637f5
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
eb640258608d626fba74bc8eca844d00ca534a17
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f43ca9def15863956205b540376904ef20cc0317ed408b6925d4bcd203d37252
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8b39f1b6b1a245fa05510947468f5adffa40c0835f8ac13208ddcc6de9716d14c5d0624b61d728620906f5d4fc67569b2d5e6c888ee5f2a036b4a8d9b526061d
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|