You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR removes the deprecated `sendMessage` method from the firebase_messaging package as part of preparing for a breaking change release. The method was deprecated due to Firebase decommissioning this functionality in June 2024.
## Changes
- Removed `sendMessage` method from main FirebaseMessaging class
- Removed method from platform interface
- Removed method from method channel implementation
- Updated tests to remove sendMessage test cases
## Migration Guide
The `sendMessage` method was Android-only and allowed sending FCM messages from the client. To migrate, use Firebase Cloud Functions or your backend server to send messages instead of the client-side method.
## Breaking Change
This removes the deprecated `sendMessage` method entirely. Apps using this method will need to migrate to server-side message sending before upgrading.
Copy file name to clipboardExpand all lines: packages/firebase_messaging/firebase_messaging_platform_interface/lib/src/method_channel/method_channel_messaging.dart
-29Lines changed: 0 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -358,35 +358,6 @@ class MethodChannelFirebaseMessaging extends FirebaseMessagingPlatform {
358
358
}
359
359
}
360
360
361
-
@override
362
-
Future<void> sendMessage({
363
-
requiredString to,
364
-
Map<String, String>? data,
365
-
String? collapseKey,
366
-
String? messageId,
367
-
String? messageType,
368
-
int? ttl,
369
-
}) async {
370
-
if (defaultTargetPlatform !=TargetPlatform.android) {
371
-
throwUnimplementedError(
372
-
'Sending of messages from the Firebase Messaging SDK is only supported on Android devices.');
Copy file name to clipboardExpand all lines: packages/firebase_messaging/firebase_messaging_platform_interface/lib/src/platform_interface/platform_interface_messaging.dart
-12Lines changed: 0 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -295,18 +295,6 @@ abstract class FirebaseMessagingPlatform extends PlatformInterface {
295
295
'setForegroundNotificationPresentationOptions() is not implemented');
296
296
}
297
297
298
-
/// Send a new [RemoteMessage] to the FCM server.
299
-
Future<void> sendMessage({
300
-
requiredString to,
301
-
Map<String, String>? data,
302
-
String? collapseKey,
303
-
String? messageId,
304
-
String? messageType,
305
-
int? ttl,
306
-
}) {
307
-
throwUnimplementedError('sendMessage() is not implemented');
308
-
}
309
-
310
298
/// Subscribe to topic in background.
311
299
///
312
300
/// [topic] must match the following regular expression:
Copy file name to clipboardExpand all lines: packages/firebase_messaging/firebase_messaging_platform_interface/test/method_channel_tests/method_channel_messaging_test.dart
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,12 @@
3
3
// Use of this source code is governed by a BSD-style license that can be
0 commit comments