我们正在开发一个应用程序,可以接收远程推送通知。我们只知道有两种类型的通知,“正常”和“沉默”。我们想知道带有消息的无声通知的JSON结构。
{
"notification_type":2,
"aps":
{
"alert":"Message de la notification",
"content-available":1,
"badge":1,
"sound":"default"
}
}发布于 2016-10-03 17:12:16
对于静默推送通知,我们省略alert、badge和sound (在静默推送中不使用)键,然后不显示通知,但调用处理程序。json应该是这样的:
{
"aps":
{
"content-available":1,
}
}你也可以在通知中发送额外的内容,这样你的应用程序就知道该怎么做了:
{
"aps":
{
"content-available":1,
}
"example-action": "example"
}https://stackoverflow.com/questions/39835693
复制相似问题