Tutorial by Examples

Complete the Installation and setup part to connect your app to Firebase. This will create the project in Firebase. Add the dependency for Firebase Cloud Messaging to your module-level build.gradle file: dependencies { compile 'com.google.firebase:firebase-messaging:10.2.1' } ...
On initial startup of your app, the FCM SDK generates a registration token for the client app instance. If you want to target single devices or create device groups, you'll need to access this token by extending FirebaseInstanceIdService. The onTokenRefresh callback fires whenever a new token is g...
This is my FirebaseMessagingService public class MyFirebaseMessagingService extends FirebaseMessagingService { Bitmap bitmap; @Override public void onMessageReceived(RemoteMessage remoteMessage) { String message = remoteMessage.getData().get("message"); //imageUri will ...
To receive messages, use a service that extends FirebaseMessagingService and override the onMessageReceived method. public class MyFcmListenerService extends FirebaseMessagingService { /** * Called when message is received. * * @param remoteMessage Object representing t...
Client apps can subscribe to any existing topic, or they can create a new topic. When a client app subscribes to a new topic name, a new topic of that name is created in FCM and any client can subsequently subscribe to it. To subscribe to a topic use the subscribeToTopic() method specifying the top...

Page 1 of 1