I had coded in ios to receive Notifications sent from "AWS SNS", notification is received if i connect the device directly to xcode and run, if i created ipa from xcode version less than 6 or ipa generation through iTunes then notification received perfectly. If i generate ipa from any xcode 6 version then notification is not received, how to fix this ? And i am using Development provisioning profile and development certificate with Push notification service enabled.
didFinishLaunchWithOptions code
if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge
|UIRemoteNotificationTypeSound
|UIRemoteNotificationTypeAlert) categories:nil];
[application registerUserNotificationSettings:settings];
} else {
UIRemoteNotificationType myTypes = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound;
[application registerForRemoteNotificationTypes:myTypes];
}
#ifdef __IPHONE_8_0
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
//register to receive notifications
[application registerForRemoteNotifications];
}
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler
{
[self showAlertIfNotificationReceives: userInfo];
//handle the actions
if ([identifier isEqualToString:@"declineAction"]){
}
else if ([identifier isEqualToString:@"answerAction"]){
}
}
#endif
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken{
NSLog(@"deviceToken: %@", deviceToken);
// Register with AWS SNS
}
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error{
NSLog(@"Failed to register with error : %@", error);
}
//Handle Notification if App is Open
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
NSLog(@"SNS Notification userInfo: %@",userInfo);
}
I am receiving device token and registered with AWS SNS successfully, but i am not receiving a notification only with ipa of xcode 6 version. Advance thanks for any help.