ios – 什么是静音推送通知?设备什么时候收到?

我想在通知栏中清除本地通知.为了这样
实现了,我正在考虑使用静音推送通知.所以我想要
确认设备何时收到它,以及我可以做什么?

解决方法

它们可以用于通知内容的应用,而无需用户通知.而不是显示通知警报,应用程序将在后台和应用程序中被唤醒:didReceiveRemoteNotification:fetchCompletionHandler:将被调用.然后,您有机会透明地处理用户的任何信息:

>下载一些内容
>同步一些元素,
>当应用程序打开时,直接通知用户

请注意,您的时间限制在30秒.

配置静通知

To support silent remote notifications,add the remote-notification value to the uibackgroundmodes array in your Info.plist file. To learn more about this array,see uibackgroundmodes.

<key>uibackgroundmodes</key>
<array>
<string>remote-notification</string>
</array>

Configuring a Silent Notification

The aps dictionary can also contain the content-available property. The content- available property with a value of 1 lets the remote notification act as a silent notification. When a silent notification arrives,iOS wakes up your app in the background so that you can get new data from your server or do background @R_321_4045@ion processing. Users aren’t told about the new or changed @R_321_4045@ion that results from a silent notification,but they can find out about it the next time they open your app.

For a silent notification,take care to ensure there is no alert,sound,or badge payload in the aps dictionary. If you don’t follow this guidance,the incorrectly-configured notification might be throttled and not delivered to the app in the background,and instead of being silent is displayed to the user

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...