Push Notification issue in iOS10

Hi

I am using below additional code snipped for ios 10


if ([NSProcessInfo instancesRespondToSelector:@selector(isOperatingSystemAtLeastVersion:)]) {

UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];

center.delegate = self;

[center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error){

if( !error ){

[[UIApplication sharedApplication] registerForRemoteNotifications];

NSLog(@"start error: %@",[error description]);

NSLog(@"granted code: %d",granted);

}

}];

}


if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)

{

UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge

|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert) categories:nil];

[[UIApplication sharedApplication] registerUserNotificationSettings:settings];

NSLog(@"current notifications : %@", [[UIApplication sharedApplication] currentUserNotificationSettings]);

}

else

{

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:

(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];

}


on ios 9 app is regsitering succesfully for push notification but on ios 10 it is getting failed with below error in function

-(void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error


Error Log


didFailToRegisterForRemoteNotificationsWithError: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo={NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}





What need to be done additional for iOS 10.

Push Notification issue in iOS10
 
 
Q