我在使用此代码获取设备令牌时收到此警报消息。
"错误域= NSCocoaErrorDomainCode = 3000"无效 为应用程序找到的aps-environment'权利字符串" Userinfo = 0x1665f5b0 {NSlocalizedDescription =无效 ' app-environment'为应用程序找到的权利字符串}
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)var_deviceToken
{
NSString *tokenString = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
NSLog(@"Push Notification tokenstring is %@",tokenString);
self.deviceToken = tokenString;
}
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
NSString* s=[[NSString alloc] initWithFormat:@"%@",error];
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Device Token didn't recieve" message:s delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}
答案 0 :(得分:1)
解决此问题的原因是,