【问题标题】:Firebase Cloud Message Not Receiving NotificationFirebase 云消息未收到通知
【发布时间】:2016-06-10 01:43:29
【问题描述】:

我对 android 开发很陌生。我最近学习使用 Firebase 云消息。我之前测试过它有效。现在它不工作了。我想知道这是否是 FCM 不起作用的原因。

上个月,我发布了我的应用程序,依赖于

compile 'com.google.firebase:firebase-messaging:9.0.0'

我在多台设备上测试过,firebase 控制台可以成功地向所有设备发送通知。

一周前,我注意到有 9.0.2 版本,但我还没有发布带有这个新依赖项的应用程序。是不是每次google推出新版本的firebase-messaging,都会让所有运行旧依赖的设备都收不到通知?

dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.4.0'
        compile 'com.android.support:design:23.4.0'
        compile 'com.google.firebase:firebase-messaging:9.0.0'
    }
apply plugin: 'com.google.gms.google-services'

【问题讨论】:

  • 应该将当前代码添加到问题中。
  • 不工作,你的意思是设备没有收到任何通知吗?您在发送通知时是否从服务器收到任何错误?
  • 没有设备收到通知
  • 新版本的消息库不应导致旧版本停止工作。 9.0.0 应该仍能按预期工作。你是如何确认设备没有收到的?另请附上您用于发送通知的请求以及您收到的回复。
  • 你解决了吗?

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


【解决方案1】:

如果显示类似于

的消息,请检查您的控制台
W/GooglePlayServicesUtil: Google Play services out of date.  Requires xxxxxxx but found yyyyyyy

那么你需要更新你的谷歌服务 由于应用程序使用的是新版本的 Firebase,并且播放服务具有旧版本,因此需要对其进行更新,否则设备将不会收到通知并显示为未注册

【讨论】:

    猜你喜欢
    • 2017-12-24
    • 2018-03-13
    • 2016-09-17
    • 2021-11-20
    • 2020-07-16
    • 1970-01-01
    • 2020-06-16
    • 1970-01-01
    • 2019-02-06
    相关资源
    最近更新 更多