Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Firebase Notifications

Introduction to Firebase Notifications

Introduction to Firebase Notifications

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 } }