0

So this just adds to the numerous issues i've had with the latest iOS8 beta update. My app was working fine using parse to send push notifications. It was working great on my phone and on the iOS7 simulators. However now I'm not receiving the notifications at all. Parse is saying my phone is still registered which it is. The console is giving me the error "registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later." Which is understandable however I believe my code solves that issue and until this update it was. I noticed as well when running the simulator that if my app is deleted from it and then I run the program again in the simulator. No dialog box is appearing asking if I want to accept push notifications, instead it is automatically setting it so they are accepted, it's doing it on my phone as well. As a side note this could potentially be a bug with the update as my other push notifications have been late/random today from other apps. However I would appreciate someone looking over the code to check please.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:252/255.0f green:230/255.0f blue:17.0/255.0f alpha:1.0]];
[[UIToolbar appearance] setBarTintColor:[UIColor colorWithRed:252/255.0f green:230/255.0f blue:17.0/255.0f alpha:1.0]];
[Parse setApplicationId:@"***"
              clientKey:@"***"];
// Register for push notifications
[application registerForRemoteNotificationTypes:
 UIRemoteNotificationTypeBadge |
 UIRemoteNotificationTypeAlert |
 UIRemoteNotificationTypeSound];


#ifdef __IPHONE_8_0
//Right, that is the point
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge
                                                                                     |UIRemoteNotificationTypeSound
                                                                                     |UIRemoteNotificationTypeAlert) categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
#else
//register to receive notifications
UIRemoteNotificationType myTypes = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound;
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:myTypes];
#endif
return YES;
}

#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
{
//handle the actions
if ([identifier isEqualToString:@"declineAction"]){
}
else if ([identifier isEqualToString:@"answerAction"]){
}
}
#endif

- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken {
// Store the deviceToken in the current installation and save it to Parse.
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
[currentInstallation setDeviceTokenFromData:newDeviceToken];
[currentInstallation saveInBackground];
}

- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo {
[PFPush handlePush:userInfo];
}

UPDATE: I created a new app in Parse and copied the application IDs etc into it (missing the certificates stage of setting it up as they won't change right?) And now even though the app says in settings that it is registered to receive notifications, again without asking) Parse says that it is not.

cjbatin
  • 283
  • 2
  • 16
  • possible duplicate of [Get the Push-Notification list on iOS8](http://stackoverflow.com/questions/24049266/get-the-push-notification-list-on-ios8) – Fosco Jul 10 '14 at 01:57
  • Nope that does not the solve the issue either :( – cjbatin Jul 10 '14 at 07:08

2 Answers2

0

Don't know how or why? But the pushes have started working again. Haven't changed any of the settings from what is above so if anyone is looking for a solution to using parse this works apparently!

cjbatin
  • 283
  • 2
  • 16
0

For iOS8 to receive push notification take a look on this : Not able to set Interactive Push Notifications on iOS8

The push notification is working and appearing, but the interactive buttons aren't working.

I think there's something related to the category..

If any one found something please update.

Community
  • 1
  • 1
RayofHope
  • 1,187
  • 2
  • 14
  • 30