![](/img/trans.png)
[英]How to remove interactive remote notification from notification center > iOS 8
[英]Remote Notification not adding in iPhone Notification Center in iOS 9
应用处于活动状态时,我的通知有效。
我启用了背景模式1.Background Fetch。 2.远程通知应用程序代理看起来像
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
//rest of code
completionHandler(UIBackgroundFetchResultNewData);
}
另外,Paylaod看起来像
{
aps={ "content-available"=1;
message="asdf"
};
}
应用状态下的通知如下
活动=工作
Background =已收到但未添加到通知中心,我需要手动单击应用程序。(我在设备通知中心看不到它)
已关闭:不起作用(预期在通知中心添加)。
我通过重新启动设备进行了测试,这可能是什么问题?
是由于有效载荷中没有“警报”,“声音”吗?
是的,您需要一个alert
值,否则通知中心中将无任何显示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.