我们正在为客户开发一个应用程序,推送通知已在Android(后台和前台)和iOS(前台)上完成。但是,当应用程序在后台运行时,从Firebase发送有效负载时,什么也不会触发。
[Export("messaging:didReceiveRemoteNotification")]
public override void DidReceiveRemoteNotification(
UIApplication application,
NSDictionary userInfo,
Action<UIBackgroundFetchResult> completionHandler)
{
displayNotification("notif1");
}
[Export("messaging:didReceiveMessage:")]
public void DidReceiveMessage(Messaging messaging, RemoteMessage remoteMessage)
{
displayNotification("notif2");
}
{
"validate_only": false,
"message": {
"data": {
"action": "Create",
"type": "A",
"source": "WEB",
"idDossier": "368",
"idCartouche": "22953",
"model": "{\"Id\":22953,\"...\":\"...\"}"
},
"notification": null,
"android": null,
"webpush": null,
"apns": {
"headers": {
"apns-expiration": "0",
"apns-priority": "10"
},
"payload": {
"aps": {
"alert": null,
"badge": null,
"sound": null,
"content-available": 1,
"mutable-content": 0,
"category": null,
"thread-id": null
}
}
},
"token": null,
"topic": "d-368-u-77ffb0d907f04bfba8a0e3f35f7fd095",
"condition": null
}
}