我在iOS应用中使用Firebase Cloud Messaging(FCM)。我现在正在尝试使用以下方法获取data message without notification
application(_:didReceiveRemoteNotification:)
我可以使用http://pushtry.com/发送数据消息吗?我曾尝试从此站点发送数据消息,但没有任何反应,而通知运行正常。
数据消息的JSON
{
"message":{
"token":"mytoken comes here",
"data":{
"Nick" : "Mario",
"body" : "great match!",
"Room" : "PortugalVSDenmark"
}
}
}
还有其他网站可以测试data message without notification
吗?
答案 0 :(得分:0)
通过将content_available
作为true
添加到有效负载中,可以使用FCM发送静默通知。
{
"message": {
"token": "mytoken comes here",
"content_available": true,
"priority": "high",
"data": {
"Nick": "Mario",
"body": "great match!",
"Room": "PortugalVSDenmark"
}
}
}