3. “a free service that enables developers to send
messages between servers and client apps. This
includes downstream messages from servers to
client apps, and upstream messages from client
apps to servers.”
13. Do I need to migrate from GCM?
● Google will continue to support GCM
● No new Client-Side feature will be added to GCM
14. Services
<service
// You only need to have this service if you want to handle the payload manually
android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service
// Extends FirebaseInstanceIdService
android:name=".MyFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
15. FirebaseInstanceIdService
@Override
public void onTokenRefresh() {
// Get updated InstanceID token.
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
Log.d(TAG, "Refreshed token: " + refreshedToken);
// TODO: Implement this method to send any registration to your app's
servers.
sendRegistrationToServer(refreshedToken);
}