I have been looking for a proper tutorial on setting push notification in Swift for iOS8 but I feel like a lot of changes have been made from Objective-C to Swift and iOS7 to iOS8, though I can't find any updated piece of code on that.
I am trying to know if the user has pushed the "Don't Allow" button in the Push Notification Alert and/or if they ever saw it.
The fact is that I would like, in that case, to show an alert asking the user to reallow notifications through settings.
Problem: I don't know which variable to check to know if I should show the popup or not.
I could use this but the hashvalue is at 0 in both cases where 1- push notification alert was never shown, 2- push notification alert was shown but user pushed "Don't Allow".
if(UIApplication.sharedApplication().currentUserNotificationSettings().hashValue == 0){
pushNotificationStatus = "false"
} else {
pushNotificationStatus = "true"
}
Would you have any best practice/idea to solve this? Thanks you!