我正在使用Ionic应用,其中我已经使用了phonegap推送插件,但它没有工作。当第一次在iPhone上安装应用程序时,它显示通知权限弹出,然后在点击允许按钮后,什么都没有发生,我也无法追踪确切的错误。
你是否有证书,有发送推送通知的权限?你在用xcode构建之前是否启用了推送通知功能?
检查你发送的有效载荷。这个payload对我来说是有效的。
{
"registration_ids":["device token"],
"content_available": true,
"notification" : {
"force-start": "1",
"content-available": "1",
"no-cache": "1",
"body":"Test" ,
"title" : "Test",
"sound" : "default" ,
"icon":"default",
"badge": 5
},
"priority":10
}
只有当你想在你的应用程序图标上显示徽章时才添加徽章