Unresolved Class ParseFirebaseInstanceIdService in AndroidManifest

前端 未结 2 889
太阳男子
太阳男子 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."

    0 讨论(0)
  • 2021-01-21 02:02

    FirebaseInstanceIdService is no longer usable. Use latest version of parse and FirebaseMessagingService

    implementation "com.github.parse-community.Parse-SDK-Android:fcm:1.21.0"
    

    And use ParseFirebaseMessagingService

    <service
        android:name="com.parse.fcm.ParseFirebaseMessagingService">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT"/>
        </intent-filter>
    </service>
    
    0 讨论(0)
提交回复
热议问题