标签:
http://blog.csdn.net/apple_app/article/details/39228221
极光推送 action设置 http://docs.jpush.cn/display/dev/IOS+8+UIUserNotificationSettings
一直更新了iOS8,但是一直没有开始研究这个iOS8,今天因为项目用到了推送,于是体验了iOS8的推送,先讲讲这个推送。目前分为四个推送:用户推送,本地推送,远程推送,地理位置推送。
我们先开始讲这个用户推送,我们要使用之前必须先注册这个推送,用户要允许这个程序进行推送
注册过程:
我们现在仅仅是注册了通知的设置,还要注册推送通知的行为,在iOS8中,行为能直接在推送消息进行,如回复消息,拒绝消息等总结就是三个方法进行注册
我们如何能进行这些行为,首先我们需注册这些行为。
我们需要注意这个UIUserNotificationActionContextDefault,如果我们使用这个,我们会得到这个推送行为,Maybe和Accept
我们还可以使用UIUserNotificationActionContextMinimal得到的是Decline和Accept行为
在这些行为注册之后,我们加上之前提到的推送设置就完成了注册推送的这个流程了
远程推送,所有消息大小不超过2KB,我们获取远程推送的json格式的消息,解析这个消息就是我们的远程推送了:
iOS7通知代理方法
后来又增加了本地通知的代理方法
iOS8的推送代理方法只有两个了
这个推送是新的API才有的特性,必须配合CLLocation定位一起使用。
最后再总结一下,整个推送流程我觉得是这样子的,先注册推送,然后推送消息,客户端接收推送消息,执行推送行为。如果有错误,还请在文章下面评论,欢迎指正。
标签:
原文地址:http://www.cnblogs.com/itlover2013/p/4586925.html