1

我正在將一箇舊應用程序從GCM遷移到FCM,並且我已經轉換了大多數東西,但是我得到了此服務,並且我對於應該如何應對一些損失繼續 - 我在遷移文檔中找不到任何東西(https://developers.google.com/cloud-messaging/android/android-migrate-fcm)我看到我可能還需要更改清單條目(<service android:name=".GCMIntentService" />)。如何將GCM意向服務轉換爲Firebase

這裏的舊服務:

public class GCMIntentService extends GCMBaseIntentService { 

    public GCMIntentService() { 
     super("GCMIntentService"); 
    } 

    @Override 
    public void onRegistered(Context context, String regId) {...} 

    @Override 
    public void onUnregistered(Context context, String regId) {...} 

    @Override 
    protected void onMessage(Context context, Intent intent) {...} 

    @Override 
    public void onError(Context context, String errorId) {...} 
} 

任何指引我們非常感激。

回答

2

看起來你正在使用一個非常古老的GCM實現。甚至在FCM發佈之前已被替換爲GcmListenerService

GCM-FCM遷移中顯示的一個符合更新版本的GCM(使用GcmListenerService)。您現在必須使用FirebaseMessagingService進行FCM。

+0

甜!非常感謝 –