iOS 接入极光推送

一、推送证书的制作

①创建一个推送的APPID

1.选择identifiers -> app ids

2.填写描述

3.Bundle ID(域名的反写)

4.勾选"Push Notifications"

5.点击上面的继续,可以看到下面的信息


6.成功创建APPID

②根据刚才新建的APPID ,制作APNS开发环境证书

1.选择certificates->development -> add新建

2.选择

3.选择APPID(自己新建的用于推送的APPID)

4.选取CSR上传(具体百度一下)

5.开发环境的推送证书制作完成

③、开发环境描述文件的制作(根据推送的APPID)

1.还是『+』

2.选择开发环境

3.选择APPID

4.选择开发者

5选择需要安装的设备

6.起个名字,制作完成


④、推送的.p12制作


选中上面的push service ,导出,把这个.p12上传到极光的服务器

二、极光推送的接入

附地址极光推送文档

1.在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法中注册极光推送时,

#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1

if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {

[JPUSHService registerForRemoteNotificationTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];

}else{

[JPUSHService registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound categories:nil];

}

#else

[JPUSHService registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound categories:nil];

#endif

[JPUSHService setupWithOption:launchOptions appKey:BFY_JPush_APP_Key channel:BFY_JPush_Channle apsForProduction:NO];

这样可以是iPhone4 7.1可以接受推送

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容