0

I am configuring push notifications on for iOS using Xcode 7 and Parse. The notifications are working perfectly on a device running iOS 9.

But when running the application on a device with iOS 8, I am running into problems. I am unable to get the Alert View where the user can select to "Allow Notifications from App X".

But, the device token registration call is being called successfully when the user opts in to push notifications and the device is successfully registering an Installation object with a valid device token. Notifications are also being sent to the device.

If I go into Settings->Notifications->My App and turn the Notifications On or Off, it doesnt make a difference the notifications are still being sent through.

This is the code I am using to register for notifications:

let settings = UIUserNotificationSettings(forTypes: UIUserNotificationType([.Alert, .Badge, .Sound]), categories: nil)
    application.registerUserNotificationSettings(settings)
    application.registerForRemoteNotifications()
R S
  • 73
  • 8

1 Answers1

0

Found the solution here on stackoverflow... Registration for notifications are sent only once on devices running versions older than iOS 9.

As answered by another user here...

"The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day."

OR

"If you want to simulate a first-time run of your app, you can leave the app uninstalled for a day. You can achieve the latter without actually waiting a day by setting the system clock forward a day or more, turning the device off completely, then turning the device back on."

Reference Links:

Push Notification ON or OFF Checking in iOS

https://developer.apple.com/library/ios/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG42

Community
  • 1
  • 1
R S
  • 73
  • 8