$30 off During Our Annual Pro Sale. View Details »

Introduction to Firebase Notifications

Introduction to Firebase Notifications

Introduction to Firebase Notifications

Avatar for Daichi Furiya (Wasabeef)

Daichi Furiya (Wasabeef)

June 10, 2016
Tweet

More Decks by Daichi Furiya (Wasabeef)

Other Decks in Programming

Transcript

  1. FirebaseMessagingService public class MyMessagingService extends FirebaseMessagingService { @Override public void

    onMessageReceived(RemoteMessage msg) { sendNotification(msg.getNotification().getBody()); } private void sendNotification(String body) { // NotificationManager#notify } }
  2. FirebaseInstancedIdService public class MyIdService extends FirebaseInstanceIdService { @Override public void

    onTokenRefresh() { sendRegistrationToServer(refreshedToken); } private void sendRegistrationToServer(String token) { // send to your server } }