没有收到Firebase Cloud Messaging通知 [英] Not receiving Firebase Cloud Messaging Notifications

查看:390
本文介绍了没有收到Firebase Cloud Messaging通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Xamarin创建一个简单的Android应用程序,该应用程序从Firebase Cloud Messaging接收推送通知.

I'm using Xamarin to create a Simple Android Application that receives Push Notifications from Firebase Cloud Messaging.

我关注了 Xamarin的文档实现此功能.

然后逐步进行操作,直到显示以下内容:

And followed it step by step until the section that reads:

背景通知

我点击了日志令牌"按钮并收到了令牌.

I tapped the Log Token Button and received the token.

下一步是从Firebase控制台发送通知,但是通知在发送后永远不会到达模拟器,并且在Firebase或Xamarin控制台上都不会记录错误.

The next step is to send the notification from Firebase Console, but the notification never gets to the emulator after sending it and no error is logged on Firebase nor the Xamarin console.

Firebase控制台将消息显示为已完成".

The Firebase console displays the message as 'Completed'.

要解决此问题,我缺少什么?

What am I missing to resolve this issue?

推荐答案

从Firebase通知控制台发送的消息被视为仅notification的消息有效负载(除非您添加自定义键值对,否则它将成为notificationdata一起.)

Messages sent from the Firebase Notifications console are treated as notification-only message payloads (unless you add in a custom key-value pair, then it becomes a notification and data together).

notification的消息有效负载行为是当应用程序在后台运行时,Android系统将处理该通知.有关行为的更多详细信息,请参见Android的处理消息.

notification-only message payload behavior is when the app is in background, the Android System will handle the notification. See Handling Messages for Android for more details on the behavior.

这篇关于没有收到Firebase Cloud Messaging通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆