FCM - onTokenRefresh() is never called

I have followed the setup process as mentioned for Firebase Cloud Messaging. But somehow onTokenRefresh is never called.

Following are changes in this regard:

app's build.gradle:

dependencies {
    ...
    compile 'com.google.firebase:firebase-messaging:9.4.0'
}

apply plugin: 'com.google.gms.google-services'

project's build.gradle:

dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
    classpath 'com.google.gms:google-services:3.0.0'
}

AndroidManifest.xml

<application
    ...
    <service
        android:name="com.blynq.app.services.MyFirebaseMessagingService">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT"/>
        </intent-filter>
    </service>

    <service
        android:name="com.blynq.app.services.MyFirebaseInstanceIDService">
        <intent-filter>
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
        </intent-filter>
    </service>

</application>


public class MyFirebaseInstanceIDService extends FirebaseInstanceIdService {

    @Override
    public void onTokenRefresh() {
        String token = FirebaseInstanceId.getInstance().getToken();
        Log.i("FCM", "Token refreshed - " + token);
        registerTokenWithServer(token);
    }
}

Logs state I/FirebaseInitProvider: FirebaseApp initialization successful, but but onTokenRefresh() is not executed.

I sure am missing something, but unable to understand where.

EDIT: Happening only with emulators, android device worked fine with the above settings.


ANSWERS:


FCM clients require devices running Android 2.3 or higher that also have the Google Play Store app installed, or an emulator running Android 2.3 with Google APIs.



 MORE:


 ? Does firebase manage user data like device token, bundle id etc at their own when sending push notifications or we have to manage these data?
 ? Firebase FCM token - When to send to server?
 ? FCM - onTokenRefresh() is never called
 ? onTokenRefresh not getting called in signed APK, if previous version of app installed doesn't have FCM implemented
 ? FCM onTokenRefresh() sometimes not called
 ? FCM onTokenRefresh() Can't create handler inside thread that has not called Looper.prepare()
 ? Firebase FCM notifications click_action payload
 ? Firebase FCM notifications click_action payload
 ? Firebase FCM notifications click_action payload
 ? Firebase console: How to specify click_action for notifications