关于APNs payLoad的一些细节问题

根据开发者文档,细节1:

Each push notification includes a payload. The payload contains information about how the system should alert the user as well as any custom data you provide. The maximum size allowed for a notification payload is 256 bytes; Apple Push Notification Service refuses any notification that exceeds this limit.

注:

payload 最大为256字节。

细节2:

If the target application isn’t running when the notification arrives, the alert message, sound, or badge value is played or shown. If the application is running, the system delivers the notification to the application delegate as an NSDictionary object. The dictionary contains the corresponding Cocoa property-list objects (plus NSNull).

如果app没有运行,就会弹出alert消息,声音和标记。如果在运行则会调用这个方法

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{}进行处理。


总的来说,使用APNs需要注意:

1  Note: Avoid using more than one action per notification. Notifications by their nature interrupt the user, and each action adds additional interruption. Apps that overuse notification actions risk annoying their users.


尽量避免发送多个消息推送,这会引起用户抱怨,从而可能删除你的应用(用户体验不好)。

关于更多细则,参考:

https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html


你可能感兴趣的:(iOS,apns,用户体验)