@react-native-firebase/messaging 23.5.0 → 23.6.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
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [23.6.0](https://github.com/invertase/react-native-firebase/compare/v23.5.0...v23.6.0) (2025-12-08)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **messaging, android:** properly remove remote message from prefs ([336901b](https://github.com/invertase/react-native-firebase/commit/336901b00f0553f57fa18ce416f513f915c9a8ed))
|
|
11
|
+
- **messaging, android:** properly shrink stored messages to limit ([53fb8c8](https://github.com/invertase/react-native-firebase/commit/53fb8c86e0ab2559a69c1309e7a1c9afec4bcb1f))
|
|
12
|
+
- **messaging, android:** purge message store to limit first, add second ([47ea774](https://github.com/invertase/react-native-firebase/commit/47ea774e2830c0ef3e95c06acfb3960a3ae0bc74))
|
|
13
|
+
|
|
6
14
|
## [23.5.0](https://github.com/invertase/react-native-firebase/compare/v23.4.1...v23.5.0) (2025-10-30)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @react-native-firebase/messaging
|
package/android/build.gradle
CHANGED
|
@@ -36,11 +36,8 @@ def jsonTargetSdk = appPackageJson['sdkVersions']['android']['targetSdk']
|
|
|
36
36
|
def jsonCompileSdk = appPackageJson['sdkVersions']['android']['compileSdk']
|
|
37
37
|
def coreVersionDetected = appPackageJson['version']
|
|
38
38
|
def coreVersionRequired = packageJson['peerDependencies'][appPackageJson['name']]
|
|
39
|
-
// Only log after build completed so log warning appears at the end
|
|
40
39
|
if (coreVersionDetected != coreVersionRequired) {
|
|
41
|
-
|
|
42
|
-
project.logger.warn("ReactNativeFirebase WARNING: NPM package '${packageJson['name']}' depends on '${appPackageJson['name']}' v${coreVersionRequired} but found v${coreVersionDetected}, this might cause build issues or runtime crashes.")
|
|
43
|
-
}
|
|
40
|
+
project.logger.warn("ReactNativeFirebase WARNING: NPM package '${packageJson['name']}' depends on '${appPackageJson['name']}' v${coreVersionRequired} but found v${coreVersionDetected}, this might cause build issues or runtime crashes.")
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
project.ext {
|
|
@@ -28,19 +28,21 @@ public class ReactNativeFirebaseMessagingStoreImpl implements ReactNativeFirebas
|
|
|
28
28
|
reactToJSON(remoteMessageToWritableMap(remoteMessage)).toString();
|
|
29
29
|
// Log.d("storeFirebaseMessage", remoteMessageString);
|
|
30
30
|
UniversalFirebasePreferences preferences = UniversalFirebasePreferences.getSharedInstance();
|
|
31
|
-
preferences.setStringValue(remoteMessage.getMessageId(), remoteMessageString);
|
|
32
|
-
// save new notification id
|
|
33
|
-
String notifications = preferences.getStringValue(S_KEY_ALL_NOTIFICATION_IDS, "");
|
|
34
|
-
notifications += remoteMessage.getMessageId() + DELIMITER; // append to last
|
|
35
31
|
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
// remove old notifications message before store to free space as needed
|
|
33
|
+
String notificationIds = preferences.getStringValue(S_KEY_ALL_NOTIFICATION_IDS, "");
|
|
34
|
+
List<String> allNotificationList = convertToArray(notificationIds);
|
|
35
|
+
while (allNotificationList.size() > MAX_SIZE_NOTIFICATIONS - 1) {
|
|
36
|
+
clearFirebaseMessage(allNotificationList.get(0));
|
|
37
|
+
allNotificationList.remove(0);
|
|
42
38
|
}
|
|
43
|
-
|
|
39
|
+
|
|
40
|
+
// now refetch the ids after possible removals, and store the new message
|
|
41
|
+
notificationIds = preferences.getStringValue(S_KEY_ALL_NOTIFICATION_IDS, "");
|
|
42
|
+
preferences.setStringValue(remoteMessage.getMessageId(), remoteMessageString);
|
|
43
|
+
// save new notification id
|
|
44
|
+
notificationIds += remoteMessage.getMessageId() + DELIMITER; // append to last
|
|
45
|
+
preferences.setStringValue(S_KEY_ALL_NOTIFICATION_IDS, notificationIds);
|
|
44
46
|
} catch (JSONException e) {
|
|
45
47
|
e.printStackTrace();
|
|
46
48
|
}
|
|
@@ -76,17 +78,17 @@ public class ReactNativeFirebaseMessagingStoreImpl implements ReactNativeFirebas
|
|
|
76
78
|
@Override
|
|
77
79
|
public void clearFirebaseMessage(String remoteMessageId) {
|
|
78
80
|
UniversalFirebasePreferences preferences = UniversalFirebasePreferences.getSharedInstance();
|
|
79
|
-
preferences.remove(remoteMessageId);
|
|
81
|
+
preferences.remove(remoteMessageId).apply();
|
|
80
82
|
// check and remove old notifications message
|
|
81
|
-
String
|
|
82
|
-
if (!
|
|
83
|
-
|
|
84
|
-
preferences.setStringValue(S_KEY_ALL_NOTIFICATION_IDS,
|
|
83
|
+
String notificationIds = preferences.getStringValue(S_KEY_ALL_NOTIFICATION_IDS, "");
|
|
84
|
+
if (!notificationIds.isEmpty()) {
|
|
85
|
+
notificationIds = removeRemoteMessageId(remoteMessageId, notificationIds); // remove from list
|
|
86
|
+
preferences.setStringValue(S_KEY_ALL_NOTIFICATION_IDS, notificationIds);
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
|
|
88
|
-
private String
|
|
89
|
-
return
|
|
90
|
+
private String removeRemoteMessageId(String remoteMessageId, String notificationIds) {
|
|
91
|
+
return notificationIds.replace(remoteMessageId + DELIMITER, "");
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
private List<String> convertToArray(String string) {
|
package/lib/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
module.exports = '23.
|
|
2
|
+
module.exports = '23.6.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-firebase/messaging",
|
|
3
|
-
"version": "23.
|
|
3
|
+
"version": "23.6.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",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"messaging"
|
|
25
25
|
],
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@react-native-firebase/app": "23.
|
|
27
|
+
"@react-native-firebase/app": "23.6.0",
|
|
28
28
|
"expo": ">=47.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"expo": "^
|
|
31
|
+
"expo": "^54.0.27"
|
|
32
32
|
},
|
|
33
33
|
"peerDependenciesMeta": {
|
|
34
34
|
"expo": {
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"access": "public",
|
|
40
40
|
"provenance": true
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "748e89f9bfcdfbee971c627cd8a698963ba09f33"
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/index.ts","./src/android/index.ts","./src/android/setupFirebaseNotifationIcon.ts"],"version":"5.9.
|
|
1
|
+
{"root":["./src/index.ts","./src/android/index.ts","./src/android/setupFirebaseNotifationIcon.ts"],"version":"5.9.3"}
|