iOS 註冊極光推送

2021-07-27 01:35:09 字數 2267 閱讀 5497

註冊極光推送

、channel

、isproduction

三個字段

#import

static

nsstring

@"*********x";

static

nsstring

*channel =

@"publish channel";

static

bool

isproduction =

false;

@inte***ce

uiresponder

<

>

@property

(strong

, nonatomic

) uiwindow

*window;

@end

極光推送的標頭檔案 和 ios 10.0 以上系統版本的

#import

"jpushservice.h"

#if __iphone_os_version_max_allowed >= __iphone_10_0

#import

#endif

三.新增**方法

@inte***ce

()<

unusernotificationcenterdelegate

,jpushregisterdelegate

> 四.

註冊極光推送

- (void

)registjpushwithlaunchoptions:(

nsdictionary

*)launchoptions

else

if([[

uidevice

currentdevice

].systemversion

floatvalue

] >=

8.0)

//如不需要使用

idfa

,advertisingidentifier

可為nil [

jpushservice

setupwithoption

:launchoptions :

channel

:channel

apsforproduction

:isproduction

advertisingidentifier

:nil];

版本新增獲取

registration id block

介面。

[jpushservice

registrationidcompletionhandler

:^(int

rescode,

nsstring

*registrationid)

else

}];

} //註冊成功,獲取

devicetoken

- (void

didregisterforremotenotificationswithdevicetoken:(

nsdata

*)devicetoken

- (void

didfailtoregisterforremotenotificationswitherror:(

nserror

*)error

#if __iphone_os_version_max_allowed > __iphone_7_1

- (void

didregisterusernotificationsettings: (

uiusernotificationsettings

*)notificationsettings

- (void

handleactionwithidentifier:(

nsstring

*)identifier

forremotenotification:(

nsdictionary

*)userinfo

completionhandler:(

void

(^)())completionhandler

#endif

+ (void

)registrationidcompletionhandler:(

void

(^)(

intrescode,

nsstring

*registrationid))completionhandler

ios極光推送

ios 極光推送整合 分類 ios開發筆記 2014 11 20 13 49 2324人閱讀收藏 舉報jpush 極光推送 jpushdemo 極光推送整合 jpush整合 稍稍研究了一下極光推送,其實是非常簡單的,不過這個過程也出現了一些問題。對於應用在前台時,需要額外處理一下。關於極光推送,由於...

iOS極光推送

目前的推送 極光,信鴿還是很不錯的選擇,本文主要解釋一下極光推送 這是極光官網的註冊,這裡需要上傳證書 按照官方文件的介紹證書的問題不是很大,boundle id 是根據證書自動識別的 需要說明一下開發環境就是需要上傳測試推送證書,生產環境是上傳測試證書 然後配置環境 設定 search paths...

iOS極光推送整合

稍稍研究了一下極光推送,其實是非常簡單的,不過這個過程也出現了一些問題。對於應用在前台時,需要額外處理一下。關於極光推送,由於在ios8之後,有了新的api,因此極光也給我們提供了適配的api。下面我就把對極光推送相關api的封裝提取出來,希望對大家有幫助,同時也當是總結。下面是對極光推送而封裝的乙...