iOS设备的标签和别名设置打印:app not registed, give up set tag
在AppDelegate里设置了push启动后然后设置:
NSSet *tags;
if ([FuncTools isAlreadyLogin]) {
tags = [NSSet setWithObjects:@"C", @"武汉", nil];
NSString *userId = [FuncTools getUserDefaultsWithKey:@"userId"];
[JPUSHService setAlias:[NSString stringWithFormat:@"c_%@",userId] callbackSelector:nil object:nil];
}else{
tags = [NSSet setWithObjects:@"C", nil];
}
[JPUSHService setTags:tags callbackSelector:nil object:nil];
但是会有提示[JPUSHService] app not registed, give up set tag:{(
C
)} alias:(null)
这个应该是jpush服务还没有启动吧?
所以我这先注释了。在登陆完成后设置了别名标签。在登出后清空了设置。但是目前看来好像没起什么作用啊。
// 登陆设置标签和别名
NSSet *tags = [NSSet setWithObjects:@"C", @"武汉", nil];
[JPUSHService setTags:tags callbackSelector:nil object:nil];
// [JPUSHService setAlias:[NSString stringWithFormat:@"c_%@",arr[0][@"ID"]] callbackSelector:@selector(tagsAliasCallback: tags: alias:) object:self];
[JPUSHService setAlias:[NSString stringWithFormat:@"c_%@",arr[0][@"ID"]] callbackSelector:nil object:nil];
而且设置了回调函数后程序还崩溃了。
如何正确设置标签别名呢?