Skip to content

Instantly share code, notes, and snippets.

@ismaeltoe
Created July 12, 2017 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ismaeltoe/a8d0457d48cd34d74cf79d16e89c0939 to your computer and use it in GitHub Desktop.
Save ismaeltoe/a8d0457d48cd34d74cf79d16e89c0939 to your computer and use it in GitHub Desktop.
public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG = MyFirebaseMessagingService.class.getSimpleName();
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if (remoteMessage.getData() != null && remoteMessage.getData().size() > 0) {
Map<String, String> data = remoteMessage.getData();
Log.d(TAG, data.toString());
}
if (remoteMessage.getNotification() != null) {
Log.d(TAG, remoteMessage.getNotification().getBody());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment