【发布时间】:2014-08-04 02:43:35
【问题描述】:
我在使用此代码获取设备令牌时收到此警报消息。
"错误域=NSCocoaErrorDomainCode=3000"无效 为应用程序找到 aps-environment'entitlement string" 用户信息=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];
}
【问题讨论】:
-
您是否在配置文件中为您的应用启用了推送通知?
标签: ios objective-c xcode5