@react-native-firebase/messaging 18.3.2 → 18.5.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 +10 -0
- package/lib/index.d.ts +1 -1
- package/lib/remoteMessageOptions.js +15 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,16 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [18.5.0](https://github.com/invertase/react-native-firebase/compare/v18.4.0...v18.5.0) (2023-09-22)
|
7
|
+
|
8
|
+
### Bug Fixes
|
9
|
+
|
10
|
+
- **messaging:** RemoteMessage.data may be JSON-serializable object as well as string ([#7316](https://github.com/invertase/react-native-firebase/issues/7316)) ([7945a24](https://github.com/invertase/react-native-firebase/commit/7945a2485a4a93fa40c509e518da23317a82b489))
|
11
|
+
|
12
|
+
## [18.4.0](https://github.com/invertase/react-native-firebase/compare/v18.3.2...v18.4.0) (2023-09-11)
|
13
|
+
|
14
|
+
**Note:** Version bump only for package @react-native-firebase/messaging
|
15
|
+
|
6
16
|
## [18.3.2](https://github.com/invertase/react-native-firebase/compare/v18.3.1...v18.3.2) (2023-09-02)
|
7
17
|
|
8
18
|
**Note:** Version bump only for package @react-native-firebase/messaging
|
package/lib/index.d.ts
CHANGED
@@ -108,7 +108,7 @@ export namespace FirebaseMessagingTypes {
|
|
108
108
|
/**
|
109
109
|
* Any additional data sent with the message.
|
110
110
|
*/
|
111
|
-
data?: { [key: string]: string };
|
111
|
+
data?: { [key: string]: string | object };
|
112
112
|
|
113
113
|
/**
|
114
114
|
* Additional NotificationPayload data sent with the message
|
@@ -65,7 +65,21 @@ export default function remoteMessageOptions(messagingSenderId, remoteMessage) {
|
|
65
65
|
} else if (!isObject(remoteMessage.data)) {
|
66
66
|
throw new Error("'remoteMessage.data' expected an object value");
|
67
67
|
} else {
|
68
|
-
|
68
|
+
// Serialize all objects to strings
|
69
|
+
out.data = {};
|
70
|
+
for (let key in remoteMessage.data) {
|
71
|
+
if (remoteMessage.data.hasOwnProperty(key)) {
|
72
|
+
if (
|
73
|
+
typeof remoteMessage.data[key] === 'object' &&
|
74
|
+
!Array.isArray(remoteMessage.data[key]) &&
|
75
|
+
remoteMessage.data[key] !== null
|
76
|
+
) {
|
77
|
+
out.data[key] = JSON.stringify(remoteMessage.data[key]);
|
78
|
+
} else {
|
79
|
+
out.data[key] = remoteMessage.data[key];
|
80
|
+
}
|
81
|
+
}
|
82
|
+
}
|
69
83
|
}
|
70
84
|
|
71
85
|
if (remoteMessage.collapseKey) {
|
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// Generated by genversion.
|
2
|
-
module.exports = '18.
|
2
|
+
module.exports = '18.5.0';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/messaging",
|
3
|
-
"version": "18.
|
3
|
+
"version": "18.5.0",
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
5
5
|
"description": "React Native Firebase - React Native Firebase provides native integration of Firebase Cloud Messaging (FCM) for both Android & iOS. FCM is a cost free service, allowing for server-device and device-device communication. The React Native Firebase Messaging module provides a simple JavaScript API to interact with FCM.",
|
6
6
|
"main": "lib/index.js",
|
@@ -22,10 +22,10 @@
|
|
22
22
|
"messaging"
|
23
23
|
],
|
24
24
|
"peerDependencies": {
|
25
|
-
"@react-native-firebase/app": "18.
|
25
|
+
"@react-native-firebase/app": "18.5.0"
|
26
26
|
},
|
27
27
|
"publishConfig": {
|
28
28
|
"access": "public"
|
29
29
|
},
|
30
|
-
"gitHead": "
|
30
|
+
"gitHead": "c9b695aa8fd75d5a1d070ecbb6bb9ac4e9ff062e"
|
31
31
|
}
|