iOS 极光推送—绑定和取消绑定别名

论坛 期权论坛 脚本     
匿名网站用户   2020-12-20 01:33   19   0

绑定和取消绑定别名

- (void)bindAlia:(NSNotification *)notification{

NSString *userId = [[NSUserDefaults standardUserDefaults] objectForKey:@"userId"];

NSString *alias;

if ([notification.object isEqualToString:@"YES"]) {//绑定

alias = [NSString stringWithFormat:@"%@",userId];

}else{//解绑

alias = @"";

}

[JPUSHService setTags:nil alias:alias fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {

// NSLog(@"绑定和解绑rescode: %d, \ntags: %@, \nalias: %@\n", iResCode, iTags , iAlias);

if (iResCode == 0) {//对应的状态码返回为0,代表成功

[[NSNotificationCenter defaultCenter] removeObserver:self name:kJPFNetworkDidLoginNotification object:nil];

}

}];

}


分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:1136255
帖子:227251
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP