iOS 接入極光推送

一、推送證書(shū)的制作

①創(chuàng)建一個(gè)推送的APPID

1.選擇identifiers -> app ids

2.填寫(xiě)描述

3.Bundle ID(域名的反寫(xiě))

4.勾選"Push Notifications"

5.點(diǎn)擊上面的繼續(xù),可以看到下面的信息


6.成功創(chuàng)建APPID

②根據(jù)剛才新建的APPID ,制作APNS開(kāi)發(fā)環(huán)境證書(shū)

1.選擇certificates->development -> add新建

2.選擇

3.選擇APPID(自己新建的用于推送的APPID)

4.選取CSR上傳(具體百度一下)

5.開(kāi)發(fā)環(huán)境的推送證書(shū)制作完成

③、開(kāi)發(fā)環(huán)境描述文件的制作(根據(jù)推送的APPID)

1.還是『+』

2.選擇開(kāi)發(fā)環(huán)境

3.選擇APPID

4.選擇開(kāi)發(fā)者

5選擇需要安裝的設(shè)備

6.起個(gè)名字,制作完成


④、推送的.p12制作


選中上面的push service ,導(dǎo)出,把這個(gè).p12上傳到極光的服務(wù)器

二、極光推送的接入

附地址極光推送文檔

1.在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法中注冊(cè)極光推送時(shí),

#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可以接受推送

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容