i edit and modify the provisioning profile alot of times. and i checked it in text editor too. everything is ok with provisioning profile. but still push notifications are not working. and i m getting this error. everyone is saying that its bcz of bad provisioning profile but my provisioning profile values are the same as Apple said in their documentation. i m getting 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}
code lookes like this in my 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 for help in advance