< p>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}
The code looks like this in my AppDelegate.m:
- (BOOL)application :(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
[selfnavigation/Subview]
> [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);
}
< p>Thanx help in advance
I have edited and modified the configuration file many times. I have also checked it in a text editor. Configuration file everything Normal. But still push notifications don’t work. I get this error. Everyone says his bcz configuration is wrong, but my profile value is the same as Apple says in their documentation. I get this error:
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}
The code looks like this in my AppDelegate.m:
p>
- (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIAlert)Notification;
br /> [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 help in advance
I believe that when you do not use the correct configuration file to sign the application, it will appear “Cannot find the application’s invalid aps -environment’entitlement string’ error. You must follow the instructions in Mahesh‘s link to generate a profile for your app. Please also note that you cannot use the team profile to sign for push notifications Application.