最新的极光推送中首先是要初始化APPkey,然后再设置对应的设备名
//生产
// [JPUSHService setupWithOption:launchOptions appKey:@"你的key"
// channel:@"Publish channel"
// apsForProduction:1
// advertisingIdentifier:advertisingId];
//生产2
[JPUSHService setupWithOption:launchOptions appKey:@"你的key"
channel:@"Publish channel"
apsForProduction:1
advertisingIdentifier:advertisingId];
设置配置名:
- (void)setUpJpush{
NSString*str =@"";
if([defaultsobjectForKey:CUSTOMER_ID]) {
str = [defaultsobjectForKey:CUSTOMER_ID];
}
NSSet *tags = [NSSet setWithObject:str];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[JPUSHServicesetTags:tagscompletion:^(NSIntegeriResCode,NSSet*iTags,NSIntegerseq) {
}seq:0];
});
}
网友评论