Last active
January 6, 2020 10:25
-
-
Save fhrzn/e94041976f44fd3367d3bc5a56dc2f04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FirebaseCloudMessagingService extends FirebaseMessagingService { | |
public String TAG = "FIREBASE MESSAGING"; | |
@Override | |
public void onMessageReceived(RemoteMessage remoteMessage) { | |
Log.d(TAG, "From: " + remoteMessage.getFrom()); | |
if (remoteMessage.getData().size() > 0) { | |
Log.d(TAG, "Message data payload: " + remoteMessage.getData()); | |
startActivity(new Intent(this, NotifikasiActivity.class)); | |
} | |
// Check if message contains a notification payload. | |
if (remoteMessage.getNotification() != null) { | |
Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody()); | |
} | |
} | |
@Override | |
public void onNewToken(String s) { | |
super.onNewToken(s); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment