@react-native-firebase/messaging 23.8.0 → 23.8.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +1197 -0
  2. package/RNFBMessaging.podspec +50 -0
  3. package/android/.editorconfig +10 -0
  4. package/android/build.gradle +149 -0
  5. package/android/lint.xml +5 -0
  6. package/android/settings.gradle +1 -0
  7. package/android/src/main/AndroidManifest.xml +43 -0
  8. package/android/src/main/java/io/invertase/firebase/messaging/JsonConvert.java +127 -0
  9. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingHeadlessService.java +30 -0
  10. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingModule.java +332 -0
  11. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingPackage.java +41 -0
  12. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingReceiver.java +66 -0
  13. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingSerializer.java +225 -0
  14. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingService.java +37 -0
  15. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingStore.java +15 -0
  16. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingStoreHelper.java +23 -0
  17. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingStoreImpl.java +97 -0
  18. package/android/src/main/res/values/colors.xml +143 -0
  19. package/app.plugin.js +1 -0
  20. package/dist/commonjs/version.js +1 -1
  21. package/dist/module/version.js +1 -1
  22. package/dist/typescript/commonjs/lib/namespaced.d.ts +1 -1
  23. package/dist/typescript/commonjs/lib/version.d.ts +1 -1
  24. package/dist/typescript/module/lib/namespaced.d.ts +1 -1
  25. package/dist/typescript/module/lib/version.d.ts +1 -1
  26. package/ios/RNFBMessaging/RNFBMessaging+AppDelegate.h +54 -0
  27. package/ios/RNFBMessaging/RNFBMessaging+AppDelegate.m +251 -0
  28. package/ios/RNFBMessaging/RNFBMessaging+FIRMessagingDelegate.h +31 -0
  29. package/ios/RNFBMessaging/RNFBMessaging+FIRMessagingDelegate.m +70 -0
  30. package/ios/RNFBMessaging/RNFBMessaging+NSNotificationCenter.h +29 -0
  31. package/ios/RNFBMessaging/RNFBMessaging+NSNotificationCenter.m +173 -0
  32. package/ios/RNFBMessaging/RNFBMessaging+UNUserNotificationCenter.h +37 -0
  33. package/ios/RNFBMessaging/RNFBMessaging+UNUserNotificationCenter.m +185 -0
  34. package/ios/RNFBMessaging/RNFBMessagingModule.h +26 -0
  35. package/ios/RNFBMessaging/RNFBMessagingModule.m +431 -0
  36. package/ios/RNFBMessaging/RNFBMessagingSerializer.h +32 -0
  37. package/ios/RNFBMessaging/RNFBMessagingSerializer.m +235 -0
  38. package/ios/RNFBMessaging.xcodeproj/project.pbxproj +384 -0
  39. package/ios/RNFBMessaging.xcodeproj/xcshareddata/IDETemplateMacros.plist +24 -0
  40. package/lib/version.ts +1 -1
  41. package/package.json +5 -15
  42. package/plugin/build/android/index.d.ts +2 -0
  43. package/plugin/build/android/index.js +5 -0
  44. package/plugin/build/android/setupFirebaseNotifationIcon.d.ts +8 -0
  45. package/plugin/build/android/setupFirebaseNotifationIcon.js +62 -0
  46. package/plugin/build/index.d.ts +3 -0
  47. package/plugin/build/index.js +16 -0
  48. package/plugin/tsconfig.tsbuildinfo +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/messaging",
3
- "version": "23.8.0",
3
+ "version": "23.8.2",
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": "./dist/commonjs/index.js",
@@ -26,13 +26,13 @@
26
26
  "messaging"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@react-native-firebase/app": "23.8.0",
29
+ "@react-native-firebase/app": "23.8.2",
30
30
  "expo": ">=47.0.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "expo": "^54.0.27",
34
- "react-native-builder-bob": "^0.40.12",
35
- "typescript": "^5.8.3"
34
+ "react-native-builder-bob": "^0.40.17",
35
+ "typescript": "^5.9.3"
36
36
  },
37
37
  "peerDependenciesMeta": {
38
38
  "expo": {
@@ -57,16 +57,6 @@
57
57
  },
58
58
  "./package.json": "./package.json"
59
59
  },
60
- "files": [
61
- "lib",
62
- "plugin/src",
63
- "tsconfig.json",
64
- "plugin/tsconfig.json",
65
- "dist",
66
- "!**/__tests__",
67
- "!**/__fixtures__",
68
- "!**/__mocks__"
69
- ],
70
60
  "react-native-builder-bob": {
71
61
  "source": "lib",
72
62
  "output": "dist",
@@ -95,5 +85,5 @@
95
85
  "node_modules/",
96
86
  "dist/"
97
87
  ],
98
- "gitHead": "724ddcfea6ebe93875e5a54ff38ca57ab5990822"
88
+ "gitHead": "578c1573d9bcb9a83848f34a08be40c7b5722d9b"
99
89
  }
@@ -0,0 +1,2 @@
1
+ import { withExpoPluginFirebaseNotification } from './setupFirebaseNotifationIcon';
2
+ export { withExpoPluginFirebaseNotification };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withExpoPluginFirebaseNotification = void 0;
4
+ const setupFirebaseNotifationIcon_1 = require("./setupFirebaseNotifationIcon");
5
+ Object.defineProperty(exports, "withExpoPluginFirebaseNotification", { enumerable: true, get: function () { return setupFirebaseNotifationIcon_1.withExpoPluginFirebaseNotification; } });
@@ -0,0 +1,8 @@
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ import { ManifestApplication } from '@expo/config-plugins/build/android/Manifest';
3
+ import { ExpoConfig } from '@expo/config-types';
4
+ /**
5
+ * Create `com.google.firebase.messaging.default_notification_icon` and `com.google.firebase.messaging.default_notification_color`
6
+ */
7
+ export declare const withExpoPluginFirebaseNotification: ConfigPlugin;
8
+ export declare function setFireBaseMessagingAndroidManifest(config: ExpoConfig, application: ManifestApplication): ManifestApplication | ExpoConfig;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withExpoPluginFirebaseNotification = void 0;
4
+ exports.setFireBaseMessagingAndroidManifest = setFireBaseMessagingAndroidManifest;
5
+ const config_plugins_1 = require("@expo/config-plugins");
6
+ /**
7
+ * Determine whether a ManifestApplication has an attribute.
8
+ */
9
+ const hasMetaData = (application, metaData) => {
10
+ return application['meta-data']?.some(item => item['$']['android:name'] === metaData);
11
+ };
12
+ /**
13
+ * Create `com.google.firebase.messaging.default_notification_icon` and `com.google.firebase.messaging.default_notification_color`
14
+ */
15
+ const withExpoPluginFirebaseNotification = config => {
16
+ return (0, config_plugins_1.withAndroidManifest)(config, async (config) => {
17
+ // Add NS `xmlns:tools to handle boundary conditions.
18
+ config.modResults.manifest.$ = {
19
+ ...config.modResults.manifest.$,
20
+ 'xmlns:tools': 'http://schemas.android.com/tools',
21
+ };
22
+ const application = config.modResults.manifest.application[0];
23
+ setFireBaseMessagingAndroidManifest(config, application);
24
+ return config;
25
+ });
26
+ };
27
+ exports.withExpoPluginFirebaseNotification = withExpoPluginFirebaseNotification;
28
+ function setFireBaseMessagingAndroidManifest(config, application) {
29
+ // If the notification object is not defined, print a friendly warning
30
+ if (!config.notification) {
31
+ // This warning is important because the notification icon can only use pure white on Android. By default, the system uses the app icon as the notification icon, but the app icon is usually not pure white, so you need to set the notification icon
32
+ // eslint-disable-next-line no-console
33
+ console.warn('For Android 8.0 and above, it is necessary to set the notification icon to ensure correct display. Otherwise, the notification will not show the correct icon. For more information, visit https://docs.expo.dev/versions/latest/config/app/#notification');
34
+ return config;
35
+ }
36
+ // Defensive code
37
+ application['meta-data'] ??= [];
38
+ const metaData = application['meta-data'];
39
+ if (config.notification.icon &&
40
+ !hasMetaData(application, 'com.google.firebase.messaging.default_notification_icon')) {
41
+ // Expo will automatically create '@drawable/notification_icon' resource if you specify config.notification.icon.
42
+ metaData.push({
43
+ $: {
44
+ 'android:name': 'com.google.firebase.messaging.default_notification_icon',
45
+ 'android:resource': '@drawable/notification_icon',
46
+ },
47
+ });
48
+ }
49
+ if (config.notification.color &&
50
+ !hasMetaData(application, 'com.google.firebase.messaging.default_notification_color')) {
51
+ metaData.push({
52
+ $: {
53
+ 'android:name': 'com.google.firebase.messaging.default_notification_color',
54
+ 'android:resource': '@color/notification_icon_color',
55
+ // @react-native-firebase/messaging will automatically configure the notification color from the 'firebase.json' file, setting 'tools:replace' = 'android:resource' to overwrite it.
56
+ // @ts-ignore
57
+ 'tools:replace': 'android:resource',
58
+ },
59
+ });
60
+ }
61
+ return application;
62
+ }
@@ -0,0 +1,3 @@
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ declare const _default: ConfigPlugin<void>;
3
+ export default _default;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_plugins_1 = require("@expo/config-plugins");
4
+ const android_1 = require("./android");
5
+ /**
6
+ * A config plugin for configuring `@react-native-firebase/app`
7
+ */
8
+ const withRnFirebaseApp = config => {
9
+ return (0, config_plugins_1.withPlugins)(config, [
10
+ // iOS
11
+ // Android
12
+ android_1.withExpoPluginFirebaseNotification,
13
+ ]);
14
+ };
15
+ const pak = require('@react-native-firebase/messaging/package.json');
16
+ exports.default = (0, config_plugins_1.createRunOncePlugin)(withRnFirebaseApp, pak.name, pak.version);
@@ -0,0 +1 @@
1
+ {"root":["./src/index.ts","./src/android/index.ts","./src/android/setupFirebaseNotifationIcon.ts"],"version":"5.9.3"}