Unresolved Class ParseFirebaseInstanceIdService in AndroidManifest

前端 未结 2 892
太阳男子
太阳男子 2021-01-21 01:18

Context: Implementing Cloud Push Notifications on Android via Parse Server

as Backend and Firebase Cloud Messaging Service

2条回答
  •  温柔的废话
    2021-01-21 01:58

    Just to add to Md. Asaduzzaman's answer, make sure to override the onNewToken() method in your custom FirebaseMessagingService, like in this tutorial. (I just found the tutorial and thought it would be nice to share it if others are stuck with the same problem).

    @Override
    public void onNewToken(String s) {
        super.onNewToken(s);
        Log.i("NEW_TOKEN", s);
    }
    

    We need to override it because:

    "FirebaseInstanceIdService: This class was deprecated. In favour of overriding onNewToken in FirebaseMessagingService.

    Once that has been implemented, this service can be safely removed."

提交回复
热议问题