0
我在使用此代码获取设备令牌时收到此警报消息。设备令牌没有收到
“错误域= NSCocoaErrorDomainCode = 3000” 找到的应用”无有效 APS-environment'entitlement串 USERINFO = 0x1665f5b0 {NSlocalizedDescription =找到应用没有有效 “APP-environment'entitlement串}
- (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];
}
您是否在供应配置文件中为您启用了推送通知? – rckoenes
在Xcode 4.3中可能重复的[如何修复]无效的应用程序'aps-environment'权限字符串?](http://stackoverflow.com/questions/10987102/how-to-fix-no-valid- aps-environment-entitlement-string-found-for-application) – memmons