onMessageReceived isn't always called

未关闭
#372 8 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@kroikie 已经在做这个了。

开始于 2017年11月10日。

评估

这个 Issue 还没有评估数据。

描述

api: messaging
  • Android device: Multiple devices
  • Android OS version: Multiple OS versions
  • Google Play Services version:
  • Firebase/Play Services SDK version: 11.4.2

The onMessageReceived method is only called for about 2/3 of the users. It's not because it's in the background because it's a data payload sent from Microsoft Azure, and the method is called for me and the notification displayed when I have the app closed. I know they're reaching the device because I checked the Play Console and they're marked as 'Acknowledged'.

Steps to reproduce:
  1. Follow the quickstart example and log the onMessageReceived call
  2. Send a message with a data payload
  3. See how many of your push notifications are logged
Observed Results:

Only about 2/3 of the notifications end up with a call to onMessageReceived.

Expected Results:

I expected all of the notifications to reach onMessageReceived.

Relevant Code:
 <service
 android:name=".push.MyFirebaseMessagingService">
     <intent-filter>
         <action android:name="com.google.firebase.MESSAGING_EVENT"/>
     </intent-filter>
 </service>
public class MyFirebaseMessagingService extends FirebaseMessagingService {

...
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
...
}
主要语言
Kotlin
星标
9.3k
派生
7.4k
平均合并
7 天 9 小时
30 天内合并 PR
6

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/quickstart-android 的其他 Issue

查看 firebase/quickstart-android 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。