推送通知不会出现在通知中心或锁定屏幕上
Push notification doesn't appear on notification center or locked screen
我正在开发一个使用推送通知的 iOS 应用程序。我关注了这个raywenderlich tutorial。
当应用程序为 运行 并调用 didReceiveRemoteNotification
方法时,我会收到通知。
但通知不会出现在通知中心或查看的屏幕上,无论是应用 运行 还是终止。
这是payload对象
payload =
{
alert = "Title goes here";
myid = 304;
xxxxxx = 51;
sound = default;
};
警报和声音必须在您的负载中的 aps
对象中:
{
"aps":
{
"alert": "blah",
"sound": "default",
},
"myid": 12345
}
我正在开发一个使用推送通知的 iOS 应用程序。我关注了这个raywenderlich tutorial。
当应用程序为 运行 并调用 didReceiveRemoteNotification
方法时,我会收到通知。
但通知不会出现在通知中心或查看的屏幕上,无论是应用 运行 还是终止。
这是payload对象
payload =
{
alert = "Title goes here";
myid = 304;
xxxxxx = 51;
sound = default;
};
警报和声音必须在您的负载中的 aps
对象中:
{
"aps":
{
"alert": "blah",
"sound": "default",
},
"myid": 12345
}