expo-notifications 0.21.0 → 0.23.0
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 +14 -0
- package/README.md +1 -1
- package/android/build.gradle +14 -8
- package/build/ServerRegistrationModule.web.d.ts.map +1 -1
- package/build/ServerRegistrationModule.web.js +6 -0
- package/build/ServerRegistrationModule.web.js.map +1 -1
- package/package.json +4 -4
- package/src/ServerRegistrationModule.web.ts +6 -0
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,20 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.23.0 — 2023-09-04
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- Added support for React Native 0.73. ([#24018](https://github.com/expo/expo/pull/24018) by [@kudo](https://github.com/kudo))
|
|
18
|
+
|
|
19
|
+
### 🐛 Bug fixes
|
|
20
|
+
|
|
21
|
+
- Fix server rendering with Metro web. ([#24195](https://github.com/expo/expo/pull/24195) by [@EvanBacon](https://github.com/EvanBacon))
|
|
22
|
+
|
|
23
|
+
## 0.22.0 — 2023-08-02
|
|
24
|
+
|
|
25
|
+
_This version does not introduce any user-facing changes._
|
|
26
|
+
|
|
13
27
|
## 0.21.0 — 2023-07-28
|
|
14
28
|
|
|
15
29
|
### 💡 Others
|
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ This module requires permission to subscribe to device boot. It's used to setup
|
|
|
126
126
|
|
|
127
127
|
### Config plugin setup (optional)
|
|
128
128
|
|
|
129
|
-
If you're using EAS Build, you can set your Android notification icon and color tint, add custom push notification sounds, and set your iOS notification environment using the expo-notifications config plugin ([what's a config plugin?](https://docs.expo.dev/
|
|
129
|
+
If you're using EAS Build, you can set your Android notification icon and color tint, add custom push notification sounds, and set your iOS notification environment using the expo-notifications config plugin ([what's a config plugin?](https://docs.expo.dev/config-plugins/introduction)). To setup, just add the config plugin to the plugins array of your `app.json` or `app.config.js` as shown below, then rebuild the app.
|
|
130
130
|
|
|
131
131
|
```json
|
|
132
132
|
{
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '0.
|
|
6
|
+
version = '0.23.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -53,13 +53,16 @@ afterEvaluate {
|
|
|
53
53
|
android {
|
|
54
54
|
compileSdkVersion safeExtGet("compileSdkVersion", 33)
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
|
|
57
|
+
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
|
|
58
|
+
compileOptions {
|
|
59
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
60
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
61
|
+
}
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
kotlinOptions {
|
|
64
|
+
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
65
|
+
}
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
namespace "expo.modules.notifications"
|
|
@@ -67,7 +70,7 @@ android {
|
|
|
67
70
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
68
71
|
targetSdkVersion safeExtGet("targetSdkVersion", 33)
|
|
69
72
|
versionCode 21
|
|
70
|
-
versionName '0.
|
|
73
|
+
versionName '0.23.0'
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
lintOptions {
|
|
@@ -78,6 +81,9 @@ android {
|
|
|
78
81
|
withSourcesJar()
|
|
79
82
|
}
|
|
80
83
|
}
|
|
84
|
+
buildFeatures {
|
|
85
|
+
buildConfig true
|
|
86
|
+
}
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
dependencies {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerRegistrationModule.web.d.ts","sourceRoot":"","sources":["../src/ServerRegistrationModule.web.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;;AAW5E,
|
|
1
|
+
{"version":3,"file":"ServerRegistrationModule.web.d.ts","sourceRoot":"","sources":["../src/ServerRegistrationModule.web.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;;AAW5E,wBA0C8B"}
|
|
@@ -22,9 +22,15 @@ export default {
|
|
|
22
22
|
return installationId;
|
|
23
23
|
},
|
|
24
24
|
getRegistrationInfoAsync: async () => {
|
|
25
|
+
if (typeof localStorage === 'undefined') {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
25
28
|
return localStorage.getItem(REGISTRATION_INFO_KEY);
|
|
26
29
|
},
|
|
27
30
|
setRegistrationInfoAsync: async (registrationInfo) => {
|
|
31
|
+
if (typeof localStorage === 'undefined') {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
28
34
|
try {
|
|
29
35
|
if (registrationInfo) {
|
|
30
36
|
localStorage.setItem(REGISTRATION_INFO_KEY, registrationInfo);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerRegistrationModule.web.js","sourceRoot":"","sources":["../src/ServerRegistrationModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIvD,MAAM,mBAAmB,GAAG,oCAAoC,CAAC;AACjE,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAErE,uDAAuD;AACvD,IAAI,yBAAyB,GAAG,GAAG,EAAE;IACnC,MAAM,qBAAqB,GAAG,MAAM,EAAE,CAAC;IACvC,yBAAyB,GAAG,GAAG,EAAE,CAAC,qBAAqB,CAAC;AAC1D,CAAC,CAAC;AAEF,eAAe;IACb,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACjC,IAAI,cAAc,CAAC;QAEnB,IAAI;YACF,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;YAC3D,IAAI,CAAC,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;gBACzD,cAAc,GAAG,MAAM,EAAE,CAAC;gBAC1B,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;aAC3D;SACF;QAAC,MAAM;YACN,cAAc,GAAG,yBAAyB,EAAE,CAAC;SAC9C;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACnC,OAAO,YAAY,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrD,CAAC;IACD,wBAAwB,EAAE,KAAK,EAAE,gBAA+B,EAAE,EAAE;QAClE,IAAI;YACF,IAAI,gBAAgB,EAAE;gBACpB,YAAY,CAAC,OAAO,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAC;aAC/D;iBAAM;gBACL,YAAY,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;aAChD;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,UAAU,CAClB,iCAAiC,EACjC,2EAA2E,KAAK,EAAE,CACnF,CAAC;SACH;IACH,CAAC;IACD,uBAAuB;IACvB,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;IACrB,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;CACE,CAAC","sourcesContent":["import { CodedError, uuidv4 } from 'expo-modules-core';\n\nimport { ServerRegistrationModule } from './ServerRegistrationModule.types';\n\nconst INSTALLATION_ID_KEY = 'EXPO_NOTIFICATIONS_INSTALLATION_ID';\nconst REGISTRATION_INFO_KEY = 'EXPO_NOTIFICATIONS_REGISTRATION_INFO';\n\n// Lazy fallback installationId per session initializer\nlet getFallbackInstallationId = () => {\n const sessionInstallationId = uuidv4();\n getFallbackInstallationId = () => sessionInstallationId;\n};\n\nexport default {\n getInstallationIdAsync: async () => {\n let installationId;\n\n try {\n installationId = localStorage.getItem(INSTALLATION_ID_KEY);\n if (!installationId || typeof installationId !== 'string') {\n installationId = uuidv4();\n localStorage.setItem(INSTALLATION_ID_KEY, installationId);\n }\n } catch {\n installationId = getFallbackInstallationId();\n }\n\n return installationId;\n },\n getRegistrationInfoAsync: async () => {\n return localStorage.getItem(REGISTRATION_INFO_KEY);\n },\n setRegistrationInfoAsync: async (registrationInfo: string | null) => {\n try {\n if (registrationInfo) {\n localStorage.setItem(REGISTRATION_INFO_KEY, registrationInfo);\n } else {\n localStorage.removeItem(REGISTRATION_INFO_KEY);\n }\n } catch (error) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_STORAGE_ERROR',\n `Could not modify localStorage to persist auto-registration information: ${error}`\n );\n }\n },\n // mock implementations\n addListener: () => {},\n removeListeners: () => {},\n} as ServerRegistrationModule;\n"]}
|
|
1
|
+
{"version":3,"file":"ServerRegistrationModule.web.js","sourceRoot":"","sources":["../src/ServerRegistrationModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIvD,MAAM,mBAAmB,GAAG,oCAAoC,CAAC;AACjE,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAErE,uDAAuD;AACvD,IAAI,yBAAyB,GAAG,GAAG,EAAE;IACnC,MAAM,qBAAqB,GAAG,MAAM,EAAE,CAAC;IACvC,yBAAyB,GAAG,GAAG,EAAE,CAAC,qBAAqB,CAAC;AAC1D,CAAC,CAAC;AAEF,eAAe;IACb,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACjC,IAAI,cAAc,CAAC;QAEnB,IAAI;YACF,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;YAC3D,IAAI,CAAC,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;gBACzD,cAAc,GAAG,MAAM,EAAE,CAAC;gBAC1B,YAAY,CAAC,OAAO,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;aAC3D;SACF;QAAC,MAAM;YACN,cAAc,GAAG,yBAAyB,EAAE,CAAC;SAC9C;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACnC,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;YACvC,OAAO,IAAI,CAAC;SACb;QACD,OAAO,YAAY,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrD,CAAC;IACD,wBAAwB,EAAE,KAAK,EAAE,gBAA+B,EAAE,EAAE;QAClE,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;YACvC,OAAO;SACR;QACD,IAAI;YACF,IAAI,gBAAgB,EAAE;gBACpB,YAAY,CAAC,OAAO,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAC;aAC/D;iBAAM;gBACL,YAAY,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;aAChD;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,UAAU,CAClB,iCAAiC,EACjC,2EAA2E,KAAK,EAAE,CACnF,CAAC;SACH;IACH,CAAC;IACD,uBAAuB;IACvB,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;IACrB,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;CACE,CAAC","sourcesContent":["import { CodedError, uuidv4 } from 'expo-modules-core';\n\nimport { ServerRegistrationModule } from './ServerRegistrationModule.types';\n\nconst INSTALLATION_ID_KEY = 'EXPO_NOTIFICATIONS_INSTALLATION_ID';\nconst REGISTRATION_INFO_KEY = 'EXPO_NOTIFICATIONS_REGISTRATION_INFO';\n\n// Lazy fallback installationId per session initializer\nlet getFallbackInstallationId = () => {\n const sessionInstallationId = uuidv4();\n getFallbackInstallationId = () => sessionInstallationId;\n};\n\nexport default {\n getInstallationIdAsync: async () => {\n let installationId;\n\n try {\n installationId = localStorage.getItem(INSTALLATION_ID_KEY);\n if (!installationId || typeof installationId !== 'string') {\n installationId = uuidv4();\n localStorage.setItem(INSTALLATION_ID_KEY, installationId);\n }\n } catch {\n installationId = getFallbackInstallationId();\n }\n\n return installationId;\n },\n getRegistrationInfoAsync: async () => {\n if (typeof localStorage === 'undefined') {\n return null;\n }\n return localStorage.getItem(REGISTRATION_INFO_KEY);\n },\n setRegistrationInfoAsync: async (registrationInfo: string | null) => {\n if (typeof localStorage === 'undefined') {\n return;\n }\n try {\n if (registrationInfo) {\n localStorage.setItem(REGISTRATION_INFO_KEY, registrationInfo);\n } else {\n localStorage.removeItem(REGISTRATION_INFO_KEY);\n }\n } catch (error) {\n throw new CodedError(\n 'ERR_NOTIFICATIONS_STORAGE_ERROR',\n `Could not modify localStorage to persist auto-registration information: ${error}`\n );\n }\n },\n // mock implementations\n addListener: () => {},\n removeListeners: () => {},\n} as ServerRegistrationModule;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-notifications",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Notifications module",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"abort-controller": "^3.0.0",
|
|
43
43
|
"assert": "^2.0.0",
|
|
44
44
|
"badgin": "^1.1.5",
|
|
45
|
-
"expo-application": "~5.
|
|
46
|
-
"expo-constants": "~
|
|
45
|
+
"expo-application": "~5.4.0",
|
|
46
|
+
"expo-constants": "~15.0.0",
|
|
47
47
|
"fs-extra": "^9.1.0",
|
|
48
48
|
"uuid": "^3.4.0"
|
|
49
49
|
},
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"expo": "*"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "79607a7325f47aa17c36d266100d09a4ff2cc544"
|
|
61
61
|
}
|
|
@@ -28,9 +28,15 @@ export default {
|
|
|
28
28
|
return installationId;
|
|
29
29
|
},
|
|
30
30
|
getRegistrationInfoAsync: async () => {
|
|
31
|
+
if (typeof localStorage === 'undefined') {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
31
34
|
return localStorage.getItem(REGISTRATION_INFO_KEY);
|
|
32
35
|
},
|
|
33
36
|
setRegistrationInfoAsync: async (registrationInfo: string | null) => {
|
|
37
|
+
if (typeof localStorage === 'undefined') {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
34
40
|
try {
|
|
35
41
|
if (registrationInfo) {
|
|
36
42
|
localStorage.setItem(REGISTRATION_INFO_KEY, registrationInfo);
|
package/tsconfig.json
CHANGED