Fix an issue with duplicate calls

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-07-16 14:28:48 +02:00
parent 2f818eef61
commit 0bd9fc8abc
2 changed files with 6 additions and 6 deletions

View file

@ -1,8 +1,4 @@
ext {
googleLibraryVersion = '9.6.1'
}
dependencies {
implementation "com.google.android.gms:play-services-gcm:${googleLibraryVersion}"
implementation "com.google.firebase:firebase-messaging:${googleLibraryVersion}"
implementation "com.google.android.gms:play-services-gcm:15.0.1"
implementation "com.google.firebase:firebase-messaging:17.1.0"
}

View file

@ -34,6 +34,10 @@ public class MagicFirebaseMessagingService extends FirebaseMessagingService {
@SuppressLint("LongLogTag")
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if (remoteMessage == null) {
return;
}
if (remoteMessage.getData() != null) {
PersistableBundleCompat persistableBundleCompat = new PersistableBundleCompat();
persistableBundleCompat.putString(BundleKeys.KEY_NOTIFICATION_SUBJECT, remoteMessage.getData().get