Skip to content

Commit b4e46db

Browse files
authored
fix(messaging, android): remove a deprecation message (#16995)
1 parent 684508d commit b4e46db

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/firebase_messaging/firebase_messaging/android/src/main/java/io/flutter/plugins/firebase/messaging/FlutterFirebaseMessagingUtils.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ class FlutterFirebaseMessagingUtils {
3535
private static final String KEY_TO = "to";
3636
private static final String KEY_TTL = "ttl";
3737

38+
// We are using a deprecated method 'getTo' which is not being replaced by any other method.
39+
// Keeping this method for backward compatibility.
40+
@SuppressWarnings("deprecation")
3841
static Map<String, Object> remoteMessageToMap(RemoteMessage remoteMessage) {
3942
Map<String, Object> messageMap = new HashMap<>();
4043
Map<String, Object> dataMap = new HashMap<>();
@@ -59,7 +62,7 @@ static Map<String, Object> remoteMessageToMap(RemoteMessage remoteMessage) {
5962
messageMap.put(KEY_MESSAGE_TYPE, remoteMessage.getMessageType());
6063
}
6164

62-
if (remoteMessage.getData().size() > 0) {
65+
if (!remoteMessage.getData().isEmpty()) {
6366
Set<Map.Entry<String, String>> entries = remoteMessage.getData().entrySet();
6467
for (Map.Entry<String, String> entry : entries) {
6568
dataMap.put(entry.getKey(), entry.getValue());

0 commit comments

Comments
 (0)