Created
December 30, 2016 08:29
-
-
Save miquelbeltran/63ffdedd20add0e76629e33f38177c9a 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 NotificationService extends FirebaseMessagingService { | |
| @Override | |
| public void onMessageReceived(RemoteMessage remoteMessage) { | |
| super.onMessageReceived(remoteMessage); | |
| Notification notification = new NotificationCompat.Builder(this) | |
| .setContentTitle(remoteMessage.getNotification().getTitle()) | |
| .setContentText(remoteMessage.getNotification().getBody()) | |
| .setSmallIcon(R.mipmap.ic_launcher) | |
| .build(); | |
| NotificationManagerCompat manager = NotificationManagerCompat.from(getApplicationContext()); | |
| manager.notify(123, notification); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment