Skip to content

Commit dd2b033

Browse files
committed
Deprecate additional FCM upstream messaging methods.
* Also removed references to upstream in documentation.
1 parent 0697dd3 commit dd2b033

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

firebase-messaging/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Unreleased
2+
* [deprecated] Deprecated additional FCM upstream messaging methods. See the
3+
[FAQ](https://firebase.google.com/support/faq#fcm-23-deprecation) for more
4+
details.
25

36

47
# 24.0.3

firebase-messaging/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060

6161
/**
6262
* Top level <a href="https://firebase.google.com/docs/cloud-messaging/">Firebase Cloud
63-
* Messaging</a> singleton that provides methods for subscribing to topics and sending upstream
64-
* messages.
63+
* Messaging</a> singleton that provides methods for generating tokens and subscribing to topics.
6564
*
6665
* <p>In order to receive messages, declare an implementation of <br>
6766
* {@link FirebaseMessagingService} in the app manifest. To process messages, override base class
@@ -515,9 +514,9 @@ public Task<Void> unsubscribeFromTopic(@NonNull String topic) {
515514
* <p>When there is an active connection the message will be sent immediately, otherwise the
516515
* message will be queued up to the time to live (TTL) set in the message.
517516
*
518-
* @deprecated FCM upstream messaging is deprecated and will be decommissioned in June 2024. Learn
519-
* more in the <a href="https://firebase.google.com/support/faq#fcm-23-deprecation">FAQ about
520-
* FCM features deprecated in June 2023</a>.
517+
* @deprecated FCM upstream messaging is decommissioned. Learn more in the
518+
* <a href="https://firebase.google.com/support/faq#fcm-23-deprecation">FAQ about FCM features
519+
* deprecated in June 2023</a>.
521520
*/
522521
@Deprecated
523522
public void send(@NonNull RemoteMessage message) {

firebase-messaging/src/main/java/com/google/firebase/messaging/FirebaseMessagingService.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
* Base class for receiving messages from Firebase Cloud Messaging.
3636
*
3737
* <p>Extending this class is required to be able to handle downstream messages. It also provides
38-
* functionality to automatically display notifications, and has methods that are invoked to give
39-
* the status of upstream messages.
38+
* functionality to automatically display notifications.
4039
*
4140
* <p>Override base class methods to handle any events required by the application. All methods are
4241
* invoked on a background thread, and <em>may be called when the app is in the background or not
@@ -127,7 +126,12 @@ public void onDeletedMessages() {}
127126
* Called when an upstream message has been successfully sent to the GCM connection server.
128127
*
129128
* @param msgId of the upstream message sent using {@link FirebaseMessaging#send}.
129+
*
130+
* @deprecated FCM upstream messaging is decommissioned. Learn more in the
131+
* <a href="https://firebase.google.com/support/faq#fcm-23-deprecation">FAQ about FCM features
132+
* deprecated in June 2023</a>.
130133
*/
134+
@Deprecated
131135
@WorkerThread
132136
public void onMessageSent(@NonNull String msgId) {}
133137

@@ -136,7 +140,12 @@ public void onMessageSent(@NonNull String msgId) {}
136140
*
137141
* @param msgId of the upstream message sent using {@link FirebaseMessaging#send}.
138142
* @param exception description of the error, typically a {@link SendException}.
143+
*
144+
* @deprecated FCM upstream messaging is decommissioned. Learn more in the
145+
* <a href="https://firebase.google.com/support/faq#fcm-23-deprecation">FAQ about FCM features
146+
* deprecated in June 2023</a>.
139147
*/
148+
@Deprecated
140149
@WorkerThread
141150
public void onSendError(@NonNull String msgId, @NonNull Exception exception) {}
142151

firebase-messaging/src/main/java/com/google/firebase/messaging/RemoteMessage.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,10 @@
4040
/**
4141
* A remote Firebase Message.
4242
*
43-
* <p>Messages will be received via {@link
44-
* FirebaseMessagingService#onMessageReceived(RemoteMessage)} and can be sent via {@link
45-
* FirebaseMessaging#send(RemoteMessage)}.
43+
* <p>Messages will be received via {@link FirebaseMessagingService#onMessageReceived(RemoteMessage)}.
4644
*
4745
* <p>Messages may have a {@link Notification} instance if they are received while the application
4846
* is in the foreground, otherwise they will be automatically posted to the notification tray.
49-
*
50-
* <p>Use the {@link Builder} class for building message instances to send via {@link
51-
* FirebaseMessaging#send(RemoteMessage)}.
5247
*/
5348
@SafeParcelable.Reserved({1 /* version field removed by bot go/versionless-safeparcelable */})
5449
@SafeParcelable.Class(creator = "RemoteMessageCreator")
@@ -115,11 +110,11 @@ public String getFrom() {
115110
/**
116111
* Gets the message destination.
117112
*
118-
* <ul>
119-
* <li>For upstream messages, this will be of the form {@code [email protected]}.
120-
* <li>For downstream messages, this will be the Firebase installations ID (FID).
121-
* </ul>
113+
* @deprecated FCM upstream messaging is decommissioned. Learn more in the
114+
* <a href="https://firebase.google.com/support/faq#fcm-23-deprecation">FAQ about FCM features
115+
* deprecated in June 2023</a>.
122116
*/
117+
@Deprecated
123118
@Nullable
124119
public String getTo() {
125120
return bundle.getString(MessagePayloadKeys.TO);
@@ -373,13 +368,13 @@ public String getMessageType() {
373368
/** @hide */
374369
@Nullable
375370
public String getCollapseKey() {
376-
return bundle.getString(MessagePayloadKeys.MESSAGE_TYPE);
371+
return bundle.getString(MessagePayloadKeys.COLLAPSE_KEY);
377372
}
378373

379374
/** @hide */
380375
@IntRange(from = 0, to = 86400)
381376
public int getTtl() {
382-
return Integer.parseInt(bundle.getString(MessagePayloadKeys.MESSAGE_TYPE, "0"));
377+
return Integer.parseInt(bundle.getString(MessagePayloadKeys.TTL, "0"));
383378
}
384379

385380
/** @hide */

0 commit comments

Comments
 (0)