第一次设备令牌是否可能为空?我已经删除了空白区域 设备令牌但仍然会在数据库中显示为空。
deviceTokenStr =[[[[deviceToken description]
stringByReplacingOccurrencesOfString: @"<" withString: @""]
stringByReplacingOccurrencesOfString: @">" withString: @""]
stringByReplacingOccurrencesOfString: @" " withString: @""];
NSLog(@"device token------------%@",deviceTokenStr);
devicetk=[deviceTokenStr retain];
NSLog(@"My token is: %@", deviceTokenStr);
答案 0 :(得分:0)
否则设备令牌不可能返回null。
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken
{
NSString *devicetoken = [[[[devToken description]
stringByReplacingOccurrencesOfString:@"<"withString:@""]
stringByReplacingOccurrencesOfString:@">" withString:@""]
stringByReplacingOccurrencesOfString: @" " withString: @""];
NSLog(@"token :: %@", devicetoken);
}