我希望在安卓应用中从GCM迁移到FCM。
我需要向GCM的旧用户发送推送通知吗?还是可以通过新的FCM从服务器发送?
FCM正常工作,我能够通过FCM接收到设备上的推送通知,但我无法通过FCM控制台向旧的GCM注册令牌发送推送通知。
以下是我在清单文件中添加的代码以使FCM正常工作-
<uses-permission android:name="com.google.android.z.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application>
<service
android:name=".view.activity.MyFcmListenerService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".view.activity.MyInstanceIDListenerService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
</application>