android - 在 android 上从 gcm 迁移到 fcm

标签 android firebase google-cloud-messaging firebase-cloud-messaging

我想在 Android 应用程序中从 gcm 迁移到 fcm。 我是否需要从 gcm 向 android 应用程序的老用户发送推送通知,或者我可以通过服务器的新 fcm 发送它?

FCM 工作正常我可以通过 fcm 在我的设备上接收推送通知,但我无法从 FCM 控制台向旧的 GCM 注册 token 发送推送通知。


下面是我添加到我的 list 文件中以使 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>

最佳答案

我想你可以通过 FCM 发送它。要了解有关 FCM 的更多信息,您可以查看 frequently asked questions about GCM to FCM 的文档.此外,如果您开始从 GCM 迁移到 FCM,则可以按照以下教程操作:

另外想了解更多信息,可以查看这个SO question .

关于android - 在 android 上从 gcm 迁移到 fcm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38019331/

相关文章:

Androidx ViewPager 不适用于 ScrollView 行为

java - 通过 IP 为 Google AdSense 启用测试广告

php - 使用 php 向 Google Cloud Messaging 发送通知给我未经授权的错误 401

android - Google 云消息传递示例

android - 获取用于 Google Cloud Messaging 的 API key

android - 带有动画的下滑和上滑布局

android - 无法在SD卡上写入文件Android模拟器

android - HTML5 全屏移动应用程序

java - 从 Firestore 获取数据时 Android 加载图标

android - 多节点添加、删除的Firebase事务