我很多次编辑和修改配置文件.我也在文本编辑器中检查过它.配置文件一切正常.但仍然推送通知不起作用.我得到这个错误.每个人都说他的bcz配置错误,但我的配置文件值与Apple在他们的文档中说的相同.我收到此错误:
Error in registration. Error: Error Domain=NSCocoaErrorDomain
Code=3000 “no valid ‘aps-environment’ entitlement string found for
application” UserInfo=0x127d80 {NSLocalizedDescription=no valid
‘aps-environment’ entitlement string found for application}
代码在我的AppDelegate.m中看起来像这样:
- (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; [self.window addSubview:navigationController.view]; [self.window makeKeyAndVisible]; return YES; } -(void)application:(UIApplication )application didRegisterForRemoteNotificationsWithDeviceToken:(NSData )deviceToken { NSString *deviceTokenStr = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""]; NSLog(@"DeviceTokenStr: %@",deviceTokenStr); }
Thanx提前帮助