@react-native-firebase/messaging 23.6.0 → 23.8.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/dist/commonjs/index.js +61 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/modular.js +439 -0
- package/dist/commonjs/modular.js.map +1 -0
- package/dist/commonjs/namespaced.js +407 -0
- package/dist/commonjs/namespaced.js.map +1 -0
- package/dist/commonjs/package.json +1 -0
- package/dist/commonjs/remoteMessageOptions.js +87 -0
- package/dist/commonjs/remoteMessageOptions.js.map +1 -0
- package/dist/commonjs/statics.js +29 -0
- package/dist/commonjs/statics.js.map +1 -0
- package/dist/commonjs/types/messaging.js +105 -0
- package/dist/commonjs/types/messaging.js.map +1 -0
- package/dist/commonjs/version.js +9 -0
- package/dist/commonjs/version.js.map +1 -0
- package/{ios/RNFBMessaging/RNFBMessaging+FIRMessagingDelegate.h → dist/module/index.js} +11 -12
- package/dist/module/index.js.map +1 -0
- package/{lib/modular/index.js → dist/module/modular.js} +135 -119
- package/dist/module/modular.js.map +1 -0
- package/{lib/index.js → dist/module/namespaced.js} +70 -193
- package/dist/module/namespaced.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/{lib → dist/module}/remoteMessageOptions.js +10 -27
- package/dist/module/remoteMessageOptions.js.map +1 -0
- package/dist/module/statics.js +25 -0
- package/dist/module/statics.js.map +1 -0
- package/dist/module/types/messaging.js +124 -0
- package/dist/module/types/messaging.js.map +1 -0
- package/dist/module/version.js +5 -0
- package/dist/module/version.js.map +1 -0
- package/dist/typescript/commonjs/lib/index.d.ts +6 -0
- package/dist/typescript/commonjs/lib/index.d.ts.map +1 -0
- package/{lib/modular/index.d.ts → dist/typescript/commonjs/lib/modular.d.ts} +86 -164
- package/dist/typescript/commonjs/lib/modular.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/namespaced.d.ts +12 -0
- package/dist/typescript/commonjs/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/remoteMessageOptions.d.ts +14 -0
- package/dist/typescript/commonjs/lib/remoteMessageOptions.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/statics.d.ts +20 -0
- package/dist/typescript/commonjs/lib/statics.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/types/messaging.d.ts +673 -0
- package/dist/typescript/commonjs/lib/types/messaging.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/version.d.ts +2 -0
- package/dist/typescript/commonjs/lib/version.d.ts.map +1 -0
- package/dist/typescript/commonjs/package.json +1 -0
- package/dist/typescript/module/lib/index.d.ts +6 -0
- package/dist/typescript/module/lib/index.d.ts.map +1 -0
- package/dist/typescript/module/lib/modular.d.ts +247 -0
- package/dist/typescript/module/lib/modular.d.ts.map +1 -0
- package/dist/typescript/module/lib/namespaced.d.ts +12 -0
- package/dist/typescript/module/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/module/lib/remoteMessageOptions.d.ts +14 -0
- package/dist/typescript/module/lib/remoteMessageOptions.d.ts.map +1 -0
- package/dist/typescript/module/lib/statics.d.ts +20 -0
- package/dist/typescript/module/lib/statics.d.ts.map +1 -0
- package/dist/typescript/module/lib/types/messaging.d.ts +673 -0
- package/dist/typescript/module/lib/types/messaging.d.ts.map +1 -0
- package/dist/typescript/module/lib/version.d.ts +2 -0
- package/dist/typescript/module/lib/version.d.ts.map +1 -0
- package/dist/typescript/module/package.json +1 -0
- package/{ios/RNFBMessaging/RNFBMessaging+UNUserNotificationCenter.h → lib/index.ts} +28 -21
- package/lib/modular.ts +447 -0
- package/lib/namespaced.ts +583 -0
- package/lib/remoteMessageOptions.ts +110 -0
- package/lib/{statics.js → statics.ts} +6 -3
- package/lib/types/messaging.ts +815 -0
- package/lib/version.ts +2 -0
- package/package.json +64 -8
- package/tsconfig.json +21 -0
- package/CHANGELOG.md +0 -1177
- package/RNFBMessaging.podspec +0 -50
- package/android/.editorconfig +0 -10
- package/android/build.gradle +0 -149
- package/android/lint.xml +0 -5
- package/android/settings.gradle +0 -1
- package/android/src/main/AndroidManifest.xml +0 -43
- package/android/src/main/java/io/invertase/firebase/messaging/JsonConvert.java +0 -127
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingHeadlessService.java +0 -30
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingModule.java +0 -332
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingPackage.java +0 -41
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingReceiver.java +0 -66
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingSerializer.java +0 -225
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingService.java +0 -37
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingStore.java +0 -15
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingStoreHelper.java +0 -23
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingStoreImpl.java +0 -97
- package/android/src/main/res/values/colors.xml +0 -143
- package/app.plugin.js +0 -1
- package/ios/RNFBMessaging/RNFBMessaging+AppDelegate.h +0 -54
- package/ios/RNFBMessaging/RNFBMessaging+AppDelegate.m +0 -251
- package/ios/RNFBMessaging/RNFBMessaging+FIRMessagingDelegate.m +0 -70
- package/ios/RNFBMessaging/RNFBMessaging+NSNotificationCenter.h +0 -29
- package/ios/RNFBMessaging/RNFBMessaging+NSNotificationCenter.m +0 -173
- package/ios/RNFBMessaging/RNFBMessaging+UNUserNotificationCenter.m +0 -185
- package/ios/RNFBMessaging/RNFBMessagingModule.h +0 -26
- package/ios/RNFBMessaging/RNFBMessagingModule.m +0 -431
- package/ios/RNFBMessaging/RNFBMessagingSerializer.h +0 -32
- package/ios/RNFBMessaging/RNFBMessagingSerializer.m +0 -235
- package/ios/RNFBMessaging.xcodeproj/project.pbxproj +0 -384
- package/ios/RNFBMessaging.xcodeproj/xcshareddata/IDETemplateMacros.plist +0 -24
- package/lib/index.d.ts +0 -1233
- package/lib/version.js +0 -2
- package/plugin/build/android/index.d.ts +0 -2
- package/plugin/build/android/index.js +0 -5
- package/plugin/build/android/setupFirebaseNotifationIcon.d.ts +0 -8
- package/plugin/build/android/setupFirebaseNotifationIcon.js +0 -62
- package/plugin/build/index.d.ts +0 -3
- package/plugin/build/index.js +0 -16
- package/plugin/tsconfig.tsbuildinfo +0 -1
|
@@ -1,185 +1,121 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
3
|
-
|
|
4
|
-
import Messaging = FirebaseMessagingTypes.Module;
|
|
5
|
-
import FirebaseApp = ReactNativeFirebase.FirebaseApp;
|
|
6
|
-
|
|
7
|
-
export const AuthorizationStatus = FirebaseMessagingTypes.AuthorizationStatus;
|
|
8
|
-
export const NotificationAndroidPriority = FirebaseMessagingTypes.NotificationAndroidPriority;
|
|
9
|
-
export const NotificationAndroidVisibility = FirebaseMessagingTypes.NotificationAndroidVisibility;
|
|
10
|
-
|
|
1
|
+
import type { Messaging, RemoteMessage, NativeTokenOptions, GetTokenOptions, IOSPermissions, AuthorizationStatus, SendErrorEvent } from './types/messaging';
|
|
2
|
+
import type { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
11
3
|
/**
|
|
12
4
|
* Returns a Messaging instance for the given app.
|
|
13
|
-
* @param app -
|
|
14
|
-
* @returns
|
|
5
|
+
* @param app - FirebaseApp. Optional.
|
|
6
|
+
* @returns Messaging instance
|
|
15
7
|
*/
|
|
16
|
-
export function getMessaging(app?: FirebaseApp): Messaging;
|
|
17
|
-
|
|
8
|
+
export declare function getMessaging(app?: ReactNativeFirebase.FirebaseApp): Messaging;
|
|
18
9
|
/**
|
|
19
10
|
* Removes access to an FCM token previously authorized by its scope.
|
|
20
11
|
* Messages sent by the server to this token will fail.
|
|
21
12
|
* @param messaging - Messaging instance.
|
|
22
13
|
* @param tokenOptions - Options to override senderId (iOS) and projectId (Android).
|
|
23
|
-
* @returns
|
|
14
|
+
* @returns Promise that resolves when the token is deleted.
|
|
24
15
|
*/
|
|
25
|
-
export function deleteToken(
|
|
26
|
-
messaging: Messaging,
|
|
27
|
-
tokenOptions?: FirebaseMessagingTypes.NativeTokenOptions,
|
|
28
|
-
): Promise<void>;
|
|
29
|
-
|
|
16
|
+
export declare function deleteToken(messaging: Messaging, tokenOptions?: NativeTokenOptions): Promise<void>;
|
|
30
17
|
/**
|
|
31
18
|
* Returns an FCM token for this device. Optionally, you can specify custom options for your own use case.
|
|
32
19
|
* @param messaging - Messaging instance.
|
|
33
20
|
* @param options - Options to override senderId (iOS) and appName.
|
|
34
|
-
* @returns
|
|
21
|
+
* @returns Promise that resolves with the FCM token.
|
|
35
22
|
*/
|
|
36
|
-
export function getToken(
|
|
37
|
-
messaging: Messaging,
|
|
38
|
-
options?: FirebaseMessagingTypes.GetTokenOptions & FirebaseMessagingTypes.NativeTokenOptions,
|
|
39
|
-
): Promise<string>;
|
|
40
|
-
|
|
23
|
+
export declare function getToken(messaging: Messaging, options?: GetTokenOptions & NativeTokenOptions): Promise<string>;
|
|
41
24
|
/**
|
|
42
25
|
* When any FCM payload is received, the listener callback is called with a `RemoteMessage`.
|
|
43
|
-
* This subscriber method is only called when the app is active (in the foreground).
|
|
26
|
+
* > This subscriber method is only called when the app is active (in the foreground).
|
|
44
27
|
* @param messaging - Messaging instance.
|
|
45
28
|
* @param listener - Called with a `RemoteMessage` when a new FCM payload is received from the server.
|
|
46
|
-
* @returns
|
|
29
|
+
* @returns Function to unsubscribe from the message listener.
|
|
47
30
|
*/
|
|
48
|
-
export function onMessage(
|
|
49
|
-
messaging: Messaging,
|
|
50
|
-
listener: (message: FirebaseMessagingTypes.RemoteMessage) => any,
|
|
51
|
-
): () => void;
|
|
52
|
-
|
|
31
|
+
export declare function onMessage(messaging: Messaging, listener: (message: RemoteMessage) => any): () => void;
|
|
53
32
|
/**
|
|
54
33
|
* When the user presses a notification displayed via FCM, this listener will be called if the app
|
|
55
34
|
* has opened from a background state.
|
|
56
35
|
* @param messaging - Messaging instance.
|
|
57
36
|
* @param listener - Called with a `RemoteMessage` when a notification press opens the application.
|
|
58
|
-
* @returns
|
|
37
|
+
* @returns Function to unsubscribe from the notification opened listener.
|
|
59
38
|
*/
|
|
60
|
-
export function onNotificationOpenedApp(
|
|
61
|
-
messaging: Messaging,
|
|
62
|
-
listener: (message: FirebaseMessagingTypes.RemoteMessage) => any,
|
|
63
|
-
): () => void;
|
|
64
|
-
|
|
39
|
+
export declare function onNotificationOpenedApp(messaging: Messaging, listener: (message: RemoteMessage) => any): () => void;
|
|
65
40
|
/**
|
|
66
|
-
* Called when a new registration token is generated for the device.
|
|
41
|
+
* Called when a new registration token is generated for the device. For example, this event can happen when a
|
|
67
42
|
* token expires or when the server invalidates the token.
|
|
68
|
-
* This subscriber method is only called when the app is active (in the foreground).
|
|
43
|
+
* > This subscriber method is only called when the app is active (in the foreground).
|
|
69
44
|
* @param messaging - Messaging instance.
|
|
70
|
-
* @param listener - Called with
|
|
71
|
-
* @returns
|
|
45
|
+
* @param listener - Called with a FCM token when the token is refreshed.
|
|
46
|
+
* @returns Function to unsubscribe from the token refresh listener.
|
|
72
47
|
*/
|
|
73
|
-
export function onTokenRefresh(messaging: Messaging, listener: (token: string) => any): () => void;
|
|
74
|
-
|
|
48
|
+
export declare function onTokenRefresh(messaging: Messaging, listener: (token: string) => any): () => void;
|
|
75
49
|
/**
|
|
76
50
|
* On iOS, messaging permission must be requested by the current application before messages can
|
|
77
51
|
* be received or sent.
|
|
78
52
|
* @param messaging - Messaging instance.
|
|
79
53
|
* @param iosPermissions - All the available permissions for iOS that can be requested.
|
|
80
|
-
* @returns
|
|
54
|
+
* @returns Promise that resolves with the authorization status.
|
|
81
55
|
*/
|
|
82
|
-
export function requestPermission(
|
|
83
|
-
messaging: Messaging,
|
|
84
|
-
iosPermissions?: FirebaseMessagingTypes.IOSPermissions,
|
|
85
|
-
): Promise<FirebaseMessagingTypes.AuthorizationStatus>;
|
|
86
|
-
|
|
56
|
+
export declare function requestPermission(messaging: Messaging, iosPermissions?: IOSPermissions): Promise<AuthorizationStatus>;
|
|
87
57
|
/**
|
|
88
58
|
* Returns whether messaging auto initialization is enabled or disabled for the device.
|
|
89
59
|
* @param messaging - Messaging instance.
|
|
90
|
-
* @returns
|
|
60
|
+
* @returns Boolean indicating whether auto initialization is enabled.
|
|
91
61
|
*/
|
|
92
|
-
export function isAutoInitEnabled(messaging: Messaging): boolean;
|
|
93
|
-
|
|
62
|
+
export declare function isAutoInitEnabled(messaging: Messaging): boolean;
|
|
94
63
|
/**
|
|
95
64
|
* Sets whether messaging auto initialization is enabled or disabled for the device.
|
|
96
65
|
* @param messaging - Messaging instance.
|
|
97
66
|
* @param enabled - A boolean value to enable or disable auto initialization.
|
|
98
|
-
* @returns
|
|
67
|
+
* @returns Promise that resolves when the setting is updated.
|
|
99
68
|
*/
|
|
100
|
-
export function setAutoInitEnabled(messaging: Messaging, enabled: boolean): Promise<void>;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Sets whether remote notification delegation to Google Play Services is enabled or disabled.
|
|
104
|
-
*
|
|
105
|
-
* The value is false by default. Set this to true to allow remote notification delegation.
|
|
106
|
-
*
|
|
107
|
-
* Warning: this will disable notification handlers on Android, and on iOS it has no effect
|
|
108
|
-
*
|
|
109
|
-
* @param messaging - Messaging instance.
|
|
110
|
-
* @param enabled A boolean value to enable or disable remote notification delegation to Google Play Services.
|
|
111
|
-
*/
|
|
112
|
-
export function setNotificationDelegationEnabled(
|
|
113
|
-
messaging: Messaging,
|
|
114
|
-
enabled: boolean,
|
|
115
|
-
): Promise<void>;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Gets whether remote notification delegation to Google Play Services is enabled or disabled.
|
|
119
|
-
*
|
|
120
|
-
* @param messaging - Messaging instance.
|
|
121
|
-
* @returns enabled A boolean value indicatign if remote notification delegation to Google Play Services is enabled.
|
|
122
|
-
*/
|
|
123
|
-
export function istNotificationDelegationEnabled(messaging: Messaging): Promise<boolean>;
|
|
124
|
-
|
|
69
|
+
export declare function setAutoInitEnabled(messaging: Messaging, enabled: boolean): Promise<void>;
|
|
125
70
|
/**
|
|
126
71
|
* When a notification from FCM has triggered the application to open from a quit state,
|
|
127
72
|
* this method will return a `RemoteMessage` containing the notification data, or `null` if
|
|
128
73
|
* the app was opened via another method.
|
|
129
74
|
* @param messaging - Messaging instance.
|
|
130
|
-
* @returns
|
|
75
|
+
* @returns Promise that resolves with the initial notification or null.
|
|
131
76
|
*/
|
|
132
|
-
export function getInitialNotification(
|
|
133
|
-
messaging: Messaging,
|
|
134
|
-
): Promise<FirebaseMessagingTypes.RemoteMessage | null>;
|
|
135
|
-
|
|
77
|
+
export declare function getInitialNotification(messaging: Messaging): Promise<RemoteMessage | null>;
|
|
136
78
|
/**
|
|
137
79
|
* When the app is opened from iOS notifications settings from a quit state,
|
|
138
80
|
* this method will return `true` or `false` if the app was opened via another method.
|
|
139
81
|
* @param messaging - Messaging instance.
|
|
140
|
-
* @returns
|
|
82
|
+
* @returns Promise that resolves with a boolean indicating if the app was opened from settings.
|
|
141
83
|
*/
|
|
142
|
-
export function getDidOpenSettingsForNotification(messaging: Messaging): Promise<boolean>;
|
|
143
|
-
|
|
84
|
+
export declare function getDidOpenSettingsForNotification(messaging: Messaging): Promise<boolean>;
|
|
144
85
|
/**
|
|
145
86
|
* Returns whether the root view is headless or not
|
|
146
|
-
* i.e
|
|
87
|
+
* i.e true if the app was launched in the background (for example, by data-only cloud message)
|
|
147
88
|
* @param messaging - Messaging instance.
|
|
148
|
-
* @returns
|
|
89
|
+
* @returns Promise that resolves with a boolean indicating if the app is headless.
|
|
149
90
|
*/
|
|
150
|
-
export function getIsHeadless(messaging: Messaging): Promise<boolean>;
|
|
151
|
-
|
|
91
|
+
export declare function getIsHeadless(messaging: Messaging): Promise<boolean>;
|
|
152
92
|
/**
|
|
153
93
|
* On iOS, if your app wants to receive remote messages from FCM (via APNs), you must explicitly register
|
|
154
94
|
* with APNs if auto-registration has been disabled.
|
|
155
95
|
* @param messaging - Messaging instance.
|
|
156
|
-
* @returns
|
|
96
|
+
* @returns Promise that resolves when the device is registered.
|
|
157
97
|
*/
|
|
158
|
-
export function registerDeviceForRemoteMessages(messaging: Messaging): Promise<void>;
|
|
159
|
-
|
|
98
|
+
export declare function registerDeviceForRemoteMessages(messaging: Messaging): Promise<void>;
|
|
160
99
|
/**
|
|
161
100
|
* Returns a boolean value whether the user has registered for remote notifications via
|
|
162
101
|
* `registerDeviceForRemoteMessages()`. For iOS. Android always returns `true`.
|
|
163
102
|
* @param messaging - Messaging instance.
|
|
164
|
-
* @returns
|
|
103
|
+
* @returns Boolean indicating if the device is registered for remote messages.
|
|
165
104
|
*/
|
|
166
|
-
export function isDeviceRegisteredForRemoteMessages(messaging: Messaging): boolean;
|
|
167
|
-
|
|
105
|
+
export declare function isDeviceRegisteredForRemoteMessages(messaging: Messaging): boolean;
|
|
168
106
|
/**
|
|
169
107
|
* Unregisters the app from receiving remote notifications.
|
|
170
108
|
* @param messaging - Messaging instance.
|
|
171
|
-
* @returns
|
|
109
|
+
* @returns Promise that resolves when the device is unregistered.
|
|
172
110
|
*/
|
|
173
|
-
export function unregisterDeviceForRemoteMessages(messaging: Messaging): Promise<void>;
|
|
174
|
-
|
|
111
|
+
export declare function unregisterDeviceForRemoteMessages(messaging: Messaging): Promise<void>;
|
|
175
112
|
/**
|
|
176
113
|
* On iOS, it is possible to get the users APNs token. This may be required if you want to send messages to your
|
|
177
114
|
* iOS devices without using the FCM service.
|
|
178
115
|
* @param messaging - Messaging instance.
|
|
179
|
-
* @returns
|
|
116
|
+
* @returns Promise that resolves with the APNs token or null.
|
|
180
117
|
*/
|
|
181
|
-
export function getAPNSToken(messaging: Messaging): Promise<string | null>;
|
|
182
|
-
|
|
118
|
+
export declare function getAPNSToken(messaging: Messaging): Promise<string | null>;
|
|
183
119
|
/**
|
|
184
120
|
* On iOS, This method is used to set the APNs Token received by the application delegate.
|
|
185
121
|
* Note that the token is expected to be a hexadecimal string, as it is an NSData type in
|
|
@@ -189,8 +125,8 @@ export function getAPNSToken(messaging: Messaging): Promise<string | null>;
|
|
|
189
125
|
*
|
|
190
126
|
* Messaging uses method swizzling to ensure that the APNs token is set automatically.
|
|
191
127
|
* However, if you have disabled swizzling by setting FirebaseAppDelegateProxyEnabled to NO
|
|
192
|
-
* in your app
|
|
193
|
-
* delegate
|
|
128
|
+
* in your app's Info.plist, you should manually set the APNs token in your application
|
|
129
|
+
* delegate's application(_:didRegisterForRemoteNotificationsWithDeviceToken:) method.
|
|
194
130
|
*
|
|
195
131
|
* If you would like to set the type of the APNs token, rather than relying on automatic
|
|
196
132
|
* detection, provide a type of either 'prod', 'sandbox'. Omitting the type parameter
|
|
@@ -201,125 +137,111 @@ export function getAPNSToken(messaging: Messaging): Promise<string | null>;
|
|
|
201
137
|
* @param messaging - Messaging instance.
|
|
202
138
|
* @param token - A hexadecimal string representing your APNs token.
|
|
203
139
|
* @param type - Optional. A string specifying 'prod', 'sandbox' or 'unknown' token type.
|
|
204
|
-
* @returns
|
|
140
|
+
* @returns Promise that resolves when the APNs token is set.
|
|
205
141
|
*/
|
|
206
|
-
export function setAPNSToken(messaging: Messaging, token: string, type?: string): Promise<void>;
|
|
207
|
-
|
|
142
|
+
export declare function setAPNSToken(messaging: Messaging, token: string, type?: string): Promise<void>;
|
|
208
143
|
/**
|
|
209
144
|
* Returns a `AuthorizationStatus` as to whether the user has messaging permission for this app.
|
|
210
145
|
* @param messaging - Messaging instance.
|
|
211
|
-
* @returns
|
|
146
|
+
* @returns Promise that resolves with the authorization status.
|
|
212
147
|
*/
|
|
213
|
-
export function hasPermission(
|
|
214
|
-
messaging: Messaging,
|
|
215
|
-
): Promise<FirebaseMessagingTypes.AuthorizationStatus>;
|
|
216
|
-
|
|
148
|
+
export declare function hasPermission(messaging: Messaging): Promise<AuthorizationStatus>;
|
|
217
149
|
/**
|
|
218
150
|
* Called when the FCM server deletes pending messages.
|
|
219
151
|
* @param messaging - Messaging instance.
|
|
220
152
|
* @param listener - Called when the FCM deletes pending messages.
|
|
221
|
-
* @returns
|
|
153
|
+
* @returns Function to unsubscribe from the deleted messages listener.
|
|
222
154
|
*/
|
|
223
|
-
export function onDeletedMessages(messaging: Messaging, listener: () => void): () => void;
|
|
224
|
-
|
|
155
|
+
export declare function onDeletedMessages(messaging: Messaging, listener: () => void): () => void;
|
|
225
156
|
/**
|
|
226
157
|
* When sending a `RemoteMessage`, this listener is called when the message has been sent to FCM.
|
|
227
158
|
* @param messaging - Messaging instance.
|
|
228
159
|
* @param listener - Called when the FCM sends the remote message to FCM.
|
|
229
|
-
* @returns
|
|
160
|
+
* @returns Function to unsubscribe from the message sent listener.
|
|
230
161
|
*/
|
|
231
|
-
export function onMessageSent(
|
|
232
|
-
messaging: Messaging,
|
|
233
|
-
listener: (messageId: string) => any,
|
|
234
|
-
): () => void;
|
|
235
|
-
|
|
162
|
+
export declare function onMessageSent(messaging: Messaging, listener: (messageId: string) => any): () => void;
|
|
236
163
|
/**
|
|
237
164
|
* When sending a `RemoteMessage`, this listener is called when an error is thrown and the
|
|
238
165
|
* message could not be sent.
|
|
239
166
|
* @param messaging - Messaging instance.
|
|
240
167
|
* @param listener - Called when the FCM sends the remote message to FCM.
|
|
241
|
-
* @returns
|
|
168
|
+
* @returns Function to unsubscribe from the send error listener.
|
|
242
169
|
*/
|
|
243
|
-
export function onSendError(
|
|
244
|
-
messaging: Messaging,
|
|
245
|
-
listener: (evt: FirebaseMessagingTypes.SendErrorEvent) => any,
|
|
246
|
-
): () => void;
|
|
247
|
-
|
|
170
|
+
export declare function onSendError(messaging: Messaging, listener: (evt: SendErrorEvent) => any): () => void;
|
|
248
171
|
/**
|
|
249
172
|
* Set a message handler function which is called when the app is in the background
|
|
250
173
|
* or terminated. In Android, a headless task is created, allowing you to access the React Native environment
|
|
251
174
|
* to perform tasks such as updating local storage, or sending a network request.
|
|
252
175
|
* @param messaging - Messaging instance.
|
|
253
176
|
* @param handler - Called when a message is sent and the application is in a background or terminated state.
|
|
254
|
-
* @returns
|
|
177
|
+
* @returns void
|
|
255
178
|
*/
|
|
256
|
-
export function setBackgroundMessageHandler(
|
|
257
|
-
messaging: Messaging,
|
|
258
|
-
handler: (message: FirebaseMessagingTypes.RemoteMessage) => Promise<any>,
|
|
259
|
-
): void;
|
|
260
|
-
|
|
179
|
+
export declare function setBackgroundMessageHandler(messaging: Messaging, handler: (message: RemoteMessage) => Promise<any>): void;
|
|
261
180
|
/**
|
|
262
181
|
* Set a handler function which is called when the `${App Name} notifications settings`
|
|
263
182
|
* link in iOS settings is clicked.
|
|
264
183
|
* @param messaging - Messaging instance.
|
|
265
184
|
* @param handler - Called when link in iOS settings is clicked.
|
|
266
|
-
* @returns
|
|
185
|
+
* @returns void
|
|
267
186
|
*/
|
|
268
|
-
export function setOpenSettingsForNotificationsHandler(
|
|
269
|
-
messaging: Messaging,
|
|
270
|
-
handler: (message: FirebaseMessagingTypes.RemoteMessage) => any,
|
|
271
|
-
): void;
|
|
272
|
-
|
|
187
|
+
export declare function setOpenSettingsForNotificationsHandler(messaging: Messaging, handler: (message: RemoteMessage) => any): void;
|
|
273
188
|
/**
|
|
274
189
|
* Send a new `RemoteMessage` to the FCM server.
|
|
275
190
|
* @param messaging - Messaging instance.
|
|
276
191
|
* @param message - A `RemoteMessage` interface.
|
|
277
|
-
* @returns
|
|
192
|
+
* @returns Promise that resolves when the message is sent.
|
|
278
193
|
*/
|
|
279
|
-
export function sendMessage(
|
|
280
|
-
messaging: Messaging,
|
|
281
|
-
message: FirebaseMessagingTypes.RemoteMessage,
|
|
282
|
-
): Promise<void>;
|
|
283
|
-
|
|
194
|
+
export declare function sendMessage(messaging: Messaging, message: RemoteMessage): Promise<void>;
|
|
284
195
|
/**
|
|
285
196
|
* Apps can subscribe to a topic, which allows the FCM server to send targeted messages to only those
|
|
286
197
|
* devices subscribed to that topic.
|
|
287
198
|
* @param messaging - Messaging instance.
|
|
288
199
|
* @param topic - The topic name.
|
|
289
|
-
* @returns
|
|
200
|
+
* @returns Promise that resolves when the subscription is complete.
|
|
290
201
|
*/
|
|
291
|
-
export function subscribeToTopic(messaging: Messaging, topic: string): Promise<void>;
|
|
292
|
-
|
|
202
|
+
export declare function subscribeToTopic(messaging: Messaging, topic: string): Promise<void>;
|
|
293
203
|
/**
|
|
294
204
|
* Unsubscribe the device from a topic.
|
|
295
205
|
* @param messaging - Messaging instance.
|
|
296
206
|
* @param topic - The topic name.
|
|
297
|
-
* @returns
|
|
207
|
+
* @returns Promise that resolves when the unsubscription is complete.
|
|
298
208
|
*/
|
|
299
|
-
export function unsubscribeFromTopic(messaging: Messaging, topic: string): Promise<void>;
|
|
300
|
-
|
|
209
|
+
export declare function unsubscribeFromTopic(messaging: Messaging, topic: string): Promise<void>;
|
|
301
210
|
/**
|
|
302
211
|
* Returns a boolean whether message delivery metrics are exported to BigQuery.
|
|
303
212
|
* @param messaging - Messaging instance.
|
|
304
|
-
* @returns
|
|
213
|
+
* @returns Boolean indicating if message delivery metrics are exported to BigQuery.
|
|
214
|
+
*/
|
|
215
|
+
export declare function isDeliveryMetricsExportToBigQueryEnabled(messaging: Messaging): boolean;
|
|
216
|
+
/**
|
|
217
|
+
* Returns a boolean whether message delegation is enabled. Android only,
|
|
218
|
+
* always returns false on iOS
|
|
219
|
+
* @param messaging - Messaging instance.
|
|
220
|
+
* @returns Boolean indicating if notification delegation is enabled.
|
|
221
|
+
*/
|
|
222
|
+
export declare function isNotificationDelegationEnabled(messaging: Messaging): boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Sets whether message notification delegation is enabled or disabled.
|
|
225
|
+
* The value is false by default. Set this to true to allow delegation of notification to Google Play Services.
|
|
226
|
+
* Note if true message handlers will not function on Android, and it has no effect on iOS
|
|
227
|
+
* @param messaging - Messaging instance.
|
|
228
|
+
* @param enabled - A boolean value to enable or disable delegation of messages to Google Play Services.
|
|
229
|
+
* @returns Promise that resolves when the setting is updated.
|
|
305
230
|
*/
|
|
306
|
-
export function
|
|
307
|
-
|
|
231
|
+
export declare function setNotificationDelegationEnabled(messaging: Messaging, enabled: boolean): Promise<void>;
|
|
308
232
|
/**
|
|
309
233
|
* Checks if all required APIs exist in the browser.
|
|
310
234
|
* @param messaging - Messaging instance.
|
|
311
|
-
* @returns
|
|
235
|
+
* @returns Promise that resolves with a boolean indicating if the APIs are supported.
|
|
312
236
|
*/
|
|
313
|
-
export function isSupported(messaging: Messaging): boolean
|
|
314
|
-
|
|
237
|
+
export declare function isSupported(messaging: Messaging): Promise<boolean>;
|
|
315
238
|
/**
|
|
316
239
|
* Sets whether message delivery metrics are exported to BigQuery is enabled or disabled.
|
|
317
240
|
* The value is false by default. Set this to true to allow exporting of message delivery metrics to BigQuery.
|
|
318
241
|
* @param messaging - Messaging instance.
|
|
319
242
|
* @param enabled - A boolean value to enable or disable exporting of message delivery metrics to BigQuery.
|
|
320
|
-
* @returns
|
|
243
|
+
* @returns Promise that resolves when the setting is updated.
|
|
321
244
|
*/
|
|
322
|
-
export function experimentalSetDeliveryMetricsExportedToBigQueryEnabled(
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
): Promise<void>;
|
|
245
|
+
export declare function experimentalSetDeliveryMetricsExportedToBigQueryEnabled(messaging: Messaging, enabled: boolean): Promise<void>;
|
|
246
|
+
export { AuthorizationStatus, NotificationAndroidPriority, NotificationAndroidVisibility, } from './statics';
|
|
247
|
+
//# sourceMappingURL=modular.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modular.d.ts","sourceRoot":"","sources":["../../../../lib/modular.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4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,EAC3B,6BAA6B,GAC9B,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Messaging, Statics } from './types/messaging';
|
|
2
|
+
import type { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
3
|
+
export declare const SDK_VERSION = "23.8.0";
|
|
4
|
+
type MessagingNamespace = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<Messaging, Statics> & {
|
|
5
|
+
messaging: ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<Messaging, Statics>;
|
|
6
|
+
firebase: ReactNativeFirebase.Module;
|
|
7
|
+
app(name?: string): ReactNativeFirebase.FirebaseApp;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: MessagingNamespace;
|
|
10
|
+
export default _default;
|
|
11
|
+
export declare const firebase: ReactNativeFirebase.FirebaseNamespacedExport<"messaging", Messaging, Statics, false>;
|
|
12
|
+
//# sourceMappingURL=namespaced.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespaced.d.ts","sourceRoot":"","sources":["../../../../lib/namespaced.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EAIR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AA0etE,eAAO,MAAM,WAAW,WAAU,CAAC;AAyBnC,KAAK,kBAAkB,GAAG,mBAAmB,CAAC,+BAA+B,CAC3E,SAAS,EACT,OAAO,CACR,GAAG;IACF,SAAS,EAAE,mBAAmB,CAAC,+BAA+B,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACnF,QAAQ,EAAE,mBAAmB,CAAC,MAAM,CAAC;IACrC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC,WAAW,CAAC;CACrD,CAAC;wBAE8C,kBAAkB;AAAlE,wBAAmE;AAKnE,eAAO,MAAM,QAAQ,EACa,mBAAmB,CAAC,wBAAwB,CAC1E,WAAW,EACX,SAAS,EACT,OAAO,EACP,KAAK,CACN,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RemoteMessage } from './types/messaging';
|
|
2
|
+
interface RemoteMessageOptions {
|
|
3
|
+
to: string;
|
|
4
|
+
messageId: string;
|
|
5
|
+
ttl: number;
|
|
6
|
+
data: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
collapseKey?: string;
|
|
10
|
+
messageType?: string;
|
|
11
|
+
}
|
|
12
|
+
export default function remoteMessageOptions(messagingSenderId: string, remoteMessage: RemoteMessage): RemoteMessageOptions;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=remoteMessageOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remoteMessageOptions.d.ts","sourceRoot":"","sources":["../../../../lib/remoteMessageOptions.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,UAAU,oBAAoB;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,iBAAiB,EAAE,MAAM,EACzB,aAAa,EAAE,aAAa,GAC3B,oBAAoB,CAqEtB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const AuthorizationStatus: {
|
|
2
|
+
readonly NOT_DETERMINED: -1;
|
|
3
|
+
readonly DENIED: 0;
|
|
4
|
+
readonly AUTHORIZED: 1;
|
|
5
|
+
readonly PROVISIONAL: 2;
|
|
6
|
+
readonly EPHEMERAL: 3;
|
|
7
|
+
};
|
|
8
|
+
export declare const NotificationAndroidPriority: {
|
|
9
|
+
readonly PRIORITY_MIN: -2;
|
|
10
|
+
readonly PRIORITY_LOW: -1;
|
|
11
|
+
readonly PRIORITY_DEFAULT: 0;
|
|
12
|
+
readonly PRIORITY_HIGH: 1;
|
|
13
|
+
readonly PRIORITY_MAX: 2;
|
|
14
|
+
};
|
|
15
|
+
export declare const NotificationAndroidVisibility: {
|
|
16
|
+
readonly VISIBILITY_SECRET: -1;
|
|
17
|
+
readonly VISIBILITY_PRIVATE: 0;
|
|
18
|
+
readonly VISIBILITY_PUBLIC: 1;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=statics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statics.d.ts","sourceRoot":"","sources":["../../../../lib/statics.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB;;;;;;CAMtB,CAAC;AAEX,eAAO,MAAM,2BAA2B;;;;;;CAM9B,CAAC;AAEX,eAAO,MAAM,6BAA6B;;;;CAIhC,CAAC"}
|