【发布时间】:2020-10-25 11:55:38
【问题描述】:
我将这个 plugin 用于我的 Xamarin Forms 应用程序 (android)。 当应用程序处于后台时,任何事件都不会触发。当应用程序在前台时,事件起作用。但是应用程序是后台任何事件都不会触发,应用程序刚刚打开。但我需要将消息参数传递给应用程序。我不确定这是否是一个错误,也许这是我的错误。我将不胜感激任何帮助。 我使用这个 api 发送消息:
https://fcm.googleapis.com/fcm/send
这是我的有效载荷:
{
"data": {
"id_serv" : "12",
"id_group" : "1",
"click_action":"Accept"
},
"notification" : {
"body" : "test",
"title" : "test"
},
"priority": "high",
"condition": "'g1' in topics"
}
我还订阅了所有可用事件 - OnNotificationAction、OnNotificationOpened、OnNotificationReceived。 我也尝试在 android 级别订阅,但这也不起作用。有什么帮助吗?
【问题讨论】:
-
将优先级设置为
MIN,然后重试 -
你在发布模式下签到了吗?
标签: android firebase xamarin.forms push-notification xamarin.android