利用SilentNotification实现PushNotification定制

苹果的PushNotification功能本身支持一定程度的定制,从而实现对国语言的支持。 Ref: Localizing the Content of Your Remote Notifications 然而,如果希望对消息进行完全的定制,决定是否显示,内容的修改等等,则需要通过 SilentNotification (即Background RemoteNotification)的后台处理实现。 原理 当Notification中含有content-avalible字段时,可以不包含title等用于显示通知的字段,这样用户就不会看到系统通知(SilentNotification) 含有content-avalible字段的通知会触发didReceiveRemoteNotification回掉,应用程序有一定时间执行后台代码(

read more »

iOS Push Notification 之 Background RemoteNotification

Background RemoteNotification 最近在调查iOS Push Notification, 发现Background RemoteNotification这个功能还挺有意思的,做一下记录: 版本需求: iOS 7以上 使用方法:指定 aps 字段 "content-available" : 1 功能:在收到通知时,唤醒后台应用并执行自定义处理逻辑,可以用于从网络获取数据 准备条件 APNs 证书

read more »