expo-notifications 1.0.0-canary-20250131-5c4e588 → 1.0.0-canary-20250219-4a5dade
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 +4 -0
- package/android/build.gradle +4 -20
- package/android/src/main/java/expo/modules/notifications/tokens/PushTokenModule.kt +18 -4
- package/expo-module.config.json +1 -1
- package/ios/EXNotifications/Notifications/EXNotificationCenterDelegate.m +1 -1
- package/ios/EXNotifications/Notifications/Records.swift +3 -3
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -10,8 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
### 🐛 Bug fixes
|
|
12
12
|
|
|
13
|
+
- fix ios textInput action missing title ([#34866](https://github.com/expo/expo/pull/34866) by [@vonovak](https://github.com/vonovak))
|
|
14
|
+
- [ios] Fixed incorrect `EXNotifications-Swift.h` import. ([#34987](https://github.com/expo/expo/pull/34987) by [@lukmccall](https://github.com/lukmccall))
|
|
15
|
+
|
|
13
16
|
### 💡 Others
|
|
14
17
|
|
|
18
|
+
- Add better error when Firebase is not set up ([#34694](https://github.com/expo/expo/pull/34694) by [@vonovak](https://github.com/vonovak))
|
|
15
19
|
- [apple] Migrate remaining `expo-module.config.json` to unified platform syntax. ([#34445](https://github.com/expo/expo/pull/34445) by [@reichhartd](https://github.com/reichhartd))
|
|
16
20
|
- [iOS] Swift conversion 6: refactor Record classes. ([#34413](https://github.com/expo/expo/pull/34413) by [@douglowder](https://github.com/douglowder))
|
|
17
21
|
|
package/android/build.gradle
CHANGED
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
6
|
-
apply from: expoModulesCorePlugin
|
|
7
|
-
applyKotlinExpoModulesCorePlugin()
|
|
8
|
-
useCoreDependencies()
|
|
9
|
-
useDefaultAndroidSdkVersions()
|
|
10
|
-
useExpoPublishing()
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
apply plugin: 'expo-module-gradle-plugin'
|
|
15
|
-
} catch (e) {
|
|
16
|
-
if (!e instanceof UnknownPluginException) {
|
|
17
|
-
throw e
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
useLegacyExpoModulesCorePlugin()
|
|
1
|
+
plugins {
|
|
2
|
+
id 'com.android.library'
|
|
3
|
+
id 'kotlin-parcelize'
|
|
4
|
+
id 'expo-module-gradle-plugin'
|
|
21
5
|
}
|
|
22
6
|
|
|
23
7
|
group = 'host.exp.exponent'
|
|
@@ -44,15 +44,15 @@ class PushTokenModule : Module(), PushTokenListener {
|
|
|
44
44
|
* @param promise Promise to be resolved with the token.
|
|
45
45
|
*/
|
|
46
46
|
AsyncFunction("getDevicePushTokenAsync") { promise: Promise ->
|
|
47
|
-
|
|
47
|
+
val instance = getFirebaseMessagingInstance(promise) ?: return@AsyncFunction
|
|
48
|
+
instance.token
|
|
48
49
|
.addOnCompleteListener { task ->
|
|
49
50
|
if (!task.isSuccessful) {
|
|
50
51
|
val exception = task.exception
|
|
51
52
|
promise.reject(REGISTRATION_FAIL_CODE, "Fetching the token failed: ${exception?.message ?: "unknown"}", exception)
|
|
52
53
|
return@addOnCompleteListener
|
|
53
54
|
}
|
|
54
|
-
val token = task.result
|
|
55
|
-
if (token == null) {
|
|
55
|
+
val token = task.result ?: run {
|
|
56
56
|
promise.reject(REGISTRATION_FAIL_CODE, "Fetching the token failed. Invalid token.", null)
|
|
57
57
|
return@addOnCompleteListener
|
|
58
58
|
}
|
|
@@ -63,7 +63,8 @@ class PushTokenModule : Module(), PushTokenListener {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
AsyncFunction("unregisterForNotificationsAsync") { promise: Promise ->
|
|
66
|
-
|
|
66
|
+
val instance = getFirebaseMessagingInstance(promise) ?: return@AsyncFunction
|
|
67
|
+
instance.deleteToken()
|
|
67
68
|
.addOnCompleteListener { task ->
|
|
68
69
|
if (!task.isSuccessful) {
|
|
69
70
|
val exception = task.exception
|
|
@@ -75,6 +76,19 @@ class PushTokenModule : Module(), PushTokenListener {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
|
|
79
|
+
private fun getFirebaseMessagingInstance(promise: Promise): FirebaseMessaging? {
|
|
80
|
+
return try {
|
|
81
|
+
FirebaseMessaging.getInstance()
|
|
82
|
+
} catch (e: IllegalStateException) {
|
|
83
|
+
promise.reject(
|
|
84
|
+
REGISTRATION_FAIL_CODE,
|
|
85
|
+
"Make sure to complete the guide at https://docs.expo.dev/push-notifications/fcm-credentials/ : ${e.message}",
|
|
86
|
+
e
|
|
87
|
+
)
|
|
88
|
+
null
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
78
92
|
/**
|
|
79
93
|
* Callback called when [PushTokenManager] gets notified of a new token.
|
|
80
94
|
* Emits a [NEW_TOKEN_EVENT_NAME] event.
|
package/expo-module.config.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#import <ExpoModulesCore/EXDefines.h>
|
|
5
5
|
#import <EXNotifications/EXNotificationsDelegate.h>
|
|
6
6
|
|
|
7
|
-
#if __has_include(<
|
|
7
|
+
#if __has_include(<EXNotifications/EXNotifications-Swift.h>)
|
|
8
8
|
#import <EXNotifications/EXNotifications-Swift.h>
|
|
9
9
|
#else
|
|
10
10
|
#import "EXNotifications-Swift.h"
|
|
@@ -198,10 +198,10 @@ struct CategoryTextInputActionRecord: Record {
|
|
|
198
198
|
self.submitButtonTitle = textInputAction.textInputButtonTitle
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
func toUNTextInputNotificationAction(identifier: String) -> UNTextInputNotificationAction {
|
|
201
|
+
func toUNTextInputNotificationAction(identifier: String, title: String) -> UNTextInputNotificationAction {
|
|
202
202
|
return UNTextInputNotificationAction(
|
|
203
203
|
identifier: identifier,
|
|
204
|
-
title: title
|
|
204
|
+
title: title,
|
|
205
205
|
textInputButtonTitle: submitButtonTitle ?? "",
|
|
206
206
|
textInputPlaceholder: placeholder ?? ""
|
|
207
207
|
)
|
|
@@ -252,7 +252,7 @@ struct CategoryActionRecord: Record {
|
|
|
252
252
|
return nil
|
|
253
253
|
}
|
|
254
254
|
if let textInput = textInput {
|
|
255
|
-
return textInput.toUNTextInputNotificationAction(identifier: identifier)
|
|
255
|
+
return textInput.toUNTextInputNotificationAction(identifier: identifier, title: buttonTitle)
|
|
256
256
|
}
|
|
257
257
|
var notificationOptions: UNNotificationActionOptions = []
|
|
258
258
|
if let optionsParams = options {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-notifications",
|
|
3
|
-
"version": "1.0.0-canary-
|
|
3
|
+
"version": "1.0.0-canary-20250219-4a5dade",
|
|
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",
|
|
@@ -38,21 +38,22 @@
|
|
|
38
38
|
"preset": "expo-module-scripts/ios"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@expo/image-utils": "0.6.
|
|
41
|
+
"@expo/image-utils": "0.6.6-canary-20250219-4a5dade",
|
|
42
42
|
"@ide/backoff": "^1.0.0",
|
|
43
43
|
"abort-controller": "^3.0.0",
|
|
44
44
|
"assert": "^2.0.0",
|
|
45
45
|
"badgin": "^1.1.5",
|
|
46
|
-
"expo-application": "6.0.3-canary-
|
|
47
|
-
"expo-constants": "
|
|
46
|
+
"expo-application": "6.0.3-canary-20250219-4a5dade",
|
|
47
|
+
"expo-constants": "18.0.0-canary-20250219-4a5dade"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"expo-module-scripts": "4.0.
|
|
50
|
+
"expo-module-scripts": "4.0.5-canary-20250219-4a5dade",
|
|
51
51
|
"memfs": "^3.2.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"expo": "53.0.0-canary-
|
|
54
|
+
"expo": "53.0.0-canary-20250219-4a5dade",
|
|
55
55
|
"react": "*",
|
|
56
56
|
"react-native": "*"
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
|
+
"gitHead": "4a5daded61d3d8b9d501059039ac74c09c25675b"
|
|
58
59
|
}
|