//tags就是用户登录后的userid
NSString *tags = [userDict objectForKey:@"id"];
[JPUSHService setTags:[NSSet setWithObjects:tags, nil] alias:tags callbackSelector:@selector(tagsAliasCallback:tags:alias:) object:self];
- (void)tagsAliasCallback:(int)iResCode
tags:(NSSet *)tags
alias:(NSString *)alias {
NSString *callbackString =
[NSString stringWithFormat:@"%d, \ntags: %@, \nalias: %@\n", iResCode,
[self logSet:tags], alias];
NSLog(@"TagsAlias回调:%@", callbackString);
}
- (NSString *)logSet:(NSSet *)dic {
if (![dic count]) {
return nil;
}
NSString *tempStr1 =
[[dic description] stringByReplacingOccurrencesOfString:@"\\u"
withString:@"\\U"];
NSString *tempStr2 =
[tempStr1 stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
NSString *tempStr3 =
[[@"\"" stringByAppendingString:tempStr2] stringByAppendingString:@"\""];
NSData *tempData = [tempStr3 dataUsingEncoding:NSUTF8StringEncoding];
NSString *str =
[NSPropertyListSerialization propertyListFromData:tempData
mutabilityOption:NSPropertyListImmutable
format:NULL
errorDescription:NULL];
return str;
}