@react-native-firebase/messaging 26.0.0 → 26.1.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,13 @@
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
+ ## [26.1.0](https://github.com/invertase/react-native-firebase/compare/v26.0.0...v26.1.0) (2026-08-03)
7
+
8
+ ### Features
9
+
10
+ - **ios:** add SPM dependency resolution support alongside CocoaPods ([#8933](https://github.com/invertase/react-native-firebase/issues/8933)) ([44a7a9a](https://github.com/invertase/react-native-firebase/commit/44a7a9ae7b404f412e9766c0417f1df8fa971a0b))
11
+ - **messaging:** make expo plugin configurable for notification icon and color ([#9132](https://github.com/invertase/react-native-firebase/issues/9132)) ([99af959](https://github.com/invertase/react-native-firebase/commit/99af9597b19bf22b78f82de2951e1b94004730cd)), closes [#8840](https://github.com/invertase/react-native-firebase/issues/8840)
12
+
6
13
  ## [26.0.0](https://github.com/invertase/react-native-firebase/compare/v25.1.0...v26.0.0) (2026-07-29)
7
14
 
8
15
  ### ⚠ BREAKING CHANGES
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require_relative '../app/firebase_spm'
2
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
3
4
  appPackage = JSON.parse(File.read(File.join('..', 'app', 'package.json')))
4
5
 
@@ -56,8 +57,12 @@ Pod::Spec.new do |s|
56
57
  end
57
58
 
58
59
  # Firebase dependencies
59
- s.dependency 'Firebase/Messaging', firebase_sdk_version
60
- s.dependency 'FirebaseCoreExtension'
60
+ # FirebaseCoreExtension is a transitive dependency of FirebaseMessaging in SPM,
61
+ # so it only needs to be declared explicitly for CocoaPods.
62
+ firebase_dependency(s, firebase_sdk_version,
63
+ ['FirebaseMessaging'],
64
+ ['Firebase/Messaging', 'FirebaseCoreExtension']
65
+ )
61
66
 
62
67
  if defined?($RNFirebaseAsStaticFramework)
63
68
  Pod::UI.puts "#{s.name}: Using overridden static_framework value of '#{$RNFirebaseAsStaticFramework}'"
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  // Generated by genversion.
4
- export const version = '26.0.0';
4
+ export const version = '26.1.0';
5
5
  //# sourceMappingURL=version.js.map
@@ -2,7 +2,7 @@ import './types/internal';
2
2
  import type { FirebaseApp } from '@react-native-firebase/app';
3
3
  import { AuthorizationStatus, NotificationAndroidPriority, NotificationAndroidVisibility } from './statics';
4
4
  import type { Messaging, RemoteMessage, IOSPermissions, AuthorizationStatus as AuthorizationStatusType, NativeTokenOptions, GetTokenOptions, SendErrorEvent } from './types/messaging';
5
- export declare const SDK_VERSION = "26.0.0";
5
+ export declare const SDK_VERSION = "26.1.0";
6
6
  export { AuthorizationStatus, NotificationAndroidPriority, NotificationAndroidVisibility };
7
7
  /**
8
8
  * Returns the {@link Messaging} instance for the default or given {@link FirebaseApp}.
@@ -1,2 +1,2 @@
1
- export declare const version = "26.0.0";
1
+ export declare const version = "26.1.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -15,7 +15,15 @@
15
15
  *
16
16
  */
17
17
 
18
+ #if __has_include(<Firebase/Firebase.h>)
18
19
  #import <Firebase/Firebase.h>
20
+ #elif __has_include(<FirebaseMessaging/FirebaseMessaging.h>)
21
+ #import <FirebaseCore/FirebaseCore.h>
22
+ #import <FirebaseMessaging/FirebaseMessaging.h>
23
+ #else
24
+ @import FirebaseCore;
25
+ @import FirebaseMessaging;
26
+ #endif
19
27
  #import <GoogleUtilities/GULAppDelegateSwizzler.h>
20
28
  #import <objc/runtime.h>
21
29
 
@@ -15,7 +15,15 @@
15
15
  *
16
16
  */
17
17
 
18
+ #if __has_include(<Firebase/Firebase.h>)
18
19
  #import <Firebase/Firebase.h>
20
+ #elif __has_include(<FirebaseMessaging/FirebaseMessaging.h>)
21
+ #import <FirebaseCore/FirebaseCore.h>
22
+ #import <FirebaseMessaging/FirebaseMessaging.h>
23
+ #else
24
+ @import FirebaseCore;
25
+ @import FirebaseMessaging;
26
+ #endif
19
27
  #import <Foundation/Foundation.h>
20
28
 
21
29
  NS_ASSUME_NONNULL_BEGIN
@@ -14,7 +14,15 @@
14
14
  * limitations under the License.
15
15
  *
16
16
  */
17
+ #if __has_include(<Firebase/Firebase.h>)
17
18
  #import <Firebase/Firebase.h>
19
+ #elif __has_include(<FirebaseMessaging/FirebaseMessaging.h>)
20
+ #import <FirebaseCore/FirebaseCore.h>
21
+ #import <FirebaseMessaging/FirebaseMessaging.h>
22
+ #else
23
+ @import FirebaseCore;
24
+ @import FirebaseMessaging;
25
+ #endif
18
26
  #import <RNFBApp/RNFBJSON.h>
19
27
  #import <RNFBApp/RNFBRCTEventEmitter.h>
20
28
  #import <RNFBApp/RNFBSharedUtils.h>
@@ -15,7 +15,15 @@
15
15
  *
16
16
  */
17
17
 
18
+ #if __has_include(<Firebase/Firebase.h>)
18
19
  #import <Firebase/Firebase.h>
20
+ #elif __has_include(<FirebaseMessaging/FirebaseMessaging.h>)
21
+ #import <FirebaseCore/FirebaseCore.h>
22
+ #import <FirebaseMessaging/FirebaseMessaging.h>
23
+ #else
24
+ @import FirebaseCore;
25
+ @import FirebaseMessaging;
26
+ #endif
19
27
  #import <RNFBApp/RNFBSharedUtils.h>
20
28
  #import <React/RCTConvert.h>
21
29
  #import <React/RCTUtils.h>
@@ -15,7 +15,15 @@
15
15
  *
16
16
  */
17
17
 
18
+ #if __has_include(<Firebase/Firebase.h>)
18
19
  #import <Firebase/Firebase.h>
20
+ #elif __has_include(<FirebaseMessaging/FirebaseMessaging.h>)
21
+ #import <FirebaseCore/FirebaseCore.h>
22
+ #import <FirebaseMessaging/FirebaseMessaging.h>
23
+ #else
24
+ @import FirebaseCore;
25
+ @import FirebaseMessaging;
26
+ #endif
19
27
  #import <Foundation/Foundation.h>
20
28
  #import <React/RCTBridgeModule.h>
21
29
 
package/lib/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '26.0.0';
2
+ export const version = '26.1.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/messaging",
3
- "version": "26.0.0",
3
+ "version": "26.1.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": "./dist/module/index.js",
@@ -42,11 +42,11 @@
42
42
  "messaging"
43
43
  ],
44
44
  "peerDependencies": {
45
- "@react-native-firebase/app": "26.0.0",
45
+ "@react-native-firebase/app": "26.1.0",
46
46
  "expo": ">=47.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@react-native-firebase/app": "26.0.0",
49
+ "@react-native-firebase/app": "26.1.0",
50
50
  "expo": "^55.0.18",
51
51
  "react-native-builder-bob": "^0.41.0",
52
52
  "typescript": "^6.0.3"
@@ -98,5 +98,5 @@
98
98
  "node_modules/",
99
99
  "dist/"
100
100
  ],
101
- "gitHead": "2a360acb2aebdd39dd40e31be386b30697270626"
101
+ "gitHead": "59d053eca14ab8aa80e5ac76887014925c67e52b"
102
102
  }
@@ -1,8 +1,9 @@
1
1
  import { ConfigPlugin } from '@expo/config-plugins';
2
2
  import { ManifestApplication } from '@expo/config-plugins/build/android/Manifest';
3
3
  import { ExpoConfig } from '@expo/config-types';
4
+ import { PluginConfigType } from '../pluginConfig';
4
5
  /**
5
6
  * Create `com.google.firebase.messaging.default_notification_icon` and `com.google.firebase.messaging.default_notification_color`
6
7
  */
7
- export declare const withExpoPluginFirebaseNotification: ConfigPlugin;
8
- export declare function setFireBaseMessagingAndroidManifest(config: ExpoConfig, application: ManifestApplication): ManifestApplication;
8
+ export declare const withExpoPluginFirebaseNotification: ConfigPlugin<PluginConfigType | undefined>;
9
+ export declare function setFireBaseMessagingAndroidManifest(config: ExpoConfig, application: ManifestApplication, props?: PluginConfigType): ManifestApplication;
@@ -12,7 +12,7 @@ const hasMetaData = (application, metaData) => {
12
12
  /**
13
13
  * Create `com.google.firebase.messaging.default_notification_icon` and `com.google.firebase.messaging.default_notification_color`
14
14
  */
15
- const withExpoPluginFirebaseNotification = config => {
15
+ const withExpoPluginFirebaseNotification = (config, props) => {
16
16
  return (0, config_plugins_1.withAndroidManifest)(config, async (config) => {
17
17
  // Add NS `xmlns:tools to handle boundary conditions.
18
18
  config.modResults.manifest.$ = {
@@ -20,14 +20,21 @@ const withExpoPluginFirebaseNotification = config => {
20
20
  'xmlns:tools': 'http://schemas.android.com/tools',
21
21
  };
22
22
  const application = config.modResults.manifest.application[0];
23
- setFireBaseMessagingAndroidManifest(config, application);
23
+ setFireBaseMessagingAndroidManifest(config, application, props);
24
24
  return config;
25
25
  });
26
26
  };
27
27
  exports.withExpoPluginFirebaseNotification = withExpoPluginFirebaseNotification;
28
- // Helper function to get notification icon and color from either config.notification or expo-notifications plugin
29
- const getNotificationConfig = (config) => {
30
- // Check expo-notifications plugin
28
+ // Helper function to get notification icon and color from plugin props, expo-notifications, or config.notification
29
+ const getNotificationConfig = (config, props) => {
30
+ // 1. Check props passed directly to @react-native-firebase/messaging plugin
31
+ if (props?.android?.notificationIcon) {
32
+ return {
33
+ icon: props.android.notificationIcon,
34
+ color: props.android.notificationColor,
35
+ };
36
+ }
37
+ // 2. Check expo-notifications plugin
31
38
  if (config.plugins) {
32
39
  const expoNotificationsPlugin = config.plugins.find(plugin => Array.isArray(plugin) && plugin[0] === 'expo-notifications');
33
40
  if (expoNotificationsPlugin && Array.isArray(expoNotificationsPlugin)) {
@@ -56,8 +63,8 @@ const getNotificationConfig = (config) => {
56
63
  }
57
64
  return { icon: undefined, color: undefined };
58
65
  };
59
- function setFireBaseMessagingAndroidManifest(config, application) {
60
- const { icon, color } = getNotificationConfig(config);
66
+ function setFireBaseMessagingAndroidManifest(config, application, props) {
67
+ const { icon, color } = getNotificationConfig(config, props);
61
68
  if (!icon) {
62
69
  // 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
63
70
  // eslint-disable-next-line no-console
@@ -1,3 +1,4 @@
1
1
  import { ConfigPlugin } from '@expo/config-plugins';
2
- declare const _default: ConfigPlugin<void>;
2
+ import { PluginConfigType } from './pluginConfig';
3
+ declare const _default: ConfigPlugin<PluginConfigType | undefined>;
3
4
  export default _default;
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const config_plugins_1 = require("@expo/config-plugins");
4
4
  const android_1 = require("./android");
5
5
  /**
6
- * A config plugin for configuring `@react-native-firebase/app`
6
+ * A config plugin for configuring `@react-native-firebase/messaging`
7
7
  */
8
- const withRnFirebaseApp = config => {
8
+ const withRnFirebaseMessaging = (config, props) => {
9
9
  return (0, config_plugins_1.withPlugins)(config, [
10
10
  // iOS
11
11
  // Android
12
- android_1.withExpoPluginFirebaseNotification,
12
+ [android_1.withExpoPluginFirebaseNotification, props],
13
13
  ]);
14
14
  };
15
15
  const pak = require('@react-native-firebase/messaging/package.json');
16
- exports.default = (0, config_plugins_1.createRunOncePlugin)(withRnFirebaseApp, pak.name, pak.version);
16
+ exports.default = (0, config_plugins_1.createRunOncePlugin)(withRnFirebaseMessaging, pak.name, pak.version);
@@ -0,0 +1,7 @@
1
+ export interface PluginConfigType {
2
+ android?: PluginConfigTypeAndroid;
3
+ }
4
+ export interface PluginConfigTypeAndroid {
5
+ notificationIcon?: string;
6
+ notificationColor?: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,7 @@
1
1
  import { ConfigPlugin, withAndroidManifest } from '@expo/config-plugins';
2
2
  import { ManifestApplication } from '@expo/config-plugins/build/android/Manifest';
3
3
  import { ExpoConfig } from '@expo/config-types';
4
+ import { PluginConfigType } from '../pluginConfig';
4
5
 
5
6
  /**
6
7
  * Determine whether a ManifestApplication has an attribute.
@@ -12,7 +13,10 @@ const hasMetaData = (application: ManifestApplication, metaData: string) => {
12
13
  /**
13
14
  * Create `com.google.firebase.messaging.default_notification_icon` and `com.google.firebase.messaging.default_notification_color`
14
15
  */
15
- export const withExpoPluginFirebaseNotification: ConfigPlugin = config => {
16
+ export const withExpoPluginFirebaseNotification: ConfigPlugin<PluginConfigType | undefined> = (
17
+ config,
18
+ props,
19
+ ) => {
16
20
  return withAndroidManifest(config, async config => {
17
21
  // Add NS `xmlns:tools to handle boundary conditions.
18
22
  config.modResults.manifest.$ = {
@@ -21,14 +25,22 @@ export const withExpoPluginFirebaseNotification: ConfigPlugin = config => {
21
25
  };
22
26
 
23
27
  const application = config.modResults.manifest.application![0];
24
- setFireBaseMessagingAndroidManifest(config, application);
28
+ setFireBaseMessagingAndroidManifest(config, application, props);
25
29
  return config;
26
30
  });
27
31
  };
28
32
 
29
- // Helper function to get notification icon and color from either config.notification or expo-notifications plugin
30
- const getNotificationConfig = (config: ExpoConfig) => {
31
- // Check expo-notifications plugin
33
+ // Helper function to get notification icon and color from plugin props, expo-notifications, or config.notification
34
+ const getNotificationConfig = (config: ExpoConfig, props?: PluginConfigType) => {
35
+ // 1. Check props passed directly to @react-native-firebase/messaging plugin
36
+ if (props?.android?.notificationIcon) {
37
+ return {
38
+ icon: props.android.notificationIcon,
39
+ color: props.android.notificationColor,
40
+ };
41
+ }
42
+
43
+ // 2. Check expo-notifications plugin
32
44
  if (config.plugins) {
33
45
  const expoNotificationsPlugin = config.plugins.find(
34
46
  plugin => Array.isArray(plugin) && plugin[0] === 'expo-notifications',
@@ -66,8 +78,9 @@ const getNotificationConfig = (config: ExpoConfig) => {
66
78
  export function setFireBaseMessagingAndroidManifest(
67
79
  config: ExpoConfig,
68
80
  application: ManifestApplication,
81
+ props?: PluginConfigType,
69
82
  ) {
70
- const { icon, color } = getNotificationConfig(config);
83
+ const { icon, color } = getNotificationConfig(config, props);
71
84
  if (!icon) {
72
85
  // 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
73
86
  // eslint-disable-next-line no-console
@@ -1,17 +1,18 @@
1
1
  import { ConfigPlugin, withPlugins, createRunOncePlugin } from '@expo/config-plugins';
2
2
  import { withExpoPluginFirebaseNotification } from './android';
3
+ import { PluginConfigType } from './pluginConfig';
3
4
 
4
5
  /**
5
- * A config plugin for configuring `@react-native-firebase/app`
6
+ * A config plugin for configuring `@react-native-firebase/messaging`
6
7
  */
7
- const withRnFirebaseApp: ConfigPlugin = config => {
8
+ const withRnFirebaseMessaging: ConfigPlugin<PluginConfigType | undefined> = (config, props) => {
8
9
  return withPlugins(config, [
9
10
  // iOS
10
11
 
11
12
  // Android
12
- withExpoPluginFirebaseNotification,
13
+ [withExpoPluginFirebaseNotification, props],
13
14
  ]);
14
15
  };
15
16
 
16
17
  const pak = require('@react-native-firebase/messaging/package.json');
17
- export default createRunOncePlugin(withRnFirebaseApp, pak.name, pak.version);
18
+ export default createRunOncePlugin(withRnFirebaseMessaging, pak.name, pak.version);
@@ -0,0 +1,8 @@
1
+ export interface PluginConfigType {
2
+ android?: PluginConfigTypeAndroid;
3
+ }
4
+
5
+ export interface PluginConfigTypeAndroid {
6
+ notificationIcon?: string;
7
+ notificationColor?: string;
8
+ }
@@ -1 +1 @@
1
- {"root":["./src/app.plugin.ts","./src/index.ts","./src/android/index.ts","./src/android/setupFirebaseNotifationIcon.ts"],"version":"6.0.3"}
1
+ {"root":["./src/app.plugin.ts","./src/index.ts","./src/pluginConfig.ts","./src/android/index.ts","./src/android/setupFirebaseNotifationIcon.ts"],"version":"6.0.3"}