iOS设备的标签和别名设置打印:app not registed, give up set tag

shumahe
8年前 4.8k 0

在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];
而且设置了回调函数后程序还崩溃了。
如何正确设置标签别名呢?

1个回答

热门排序
  • cindychen
    8年前
    是需要已登录后才能进行设置tag、alias建议你加上监听打印:建议开发者加上API里面提供下面 5 种类型的通知: extern NSString * const kJPFNetworkDidSetupNotification; // 建 展示全部