How I can ask for permissions in iOs 8 and iOs7 both. I've tried this:
UIApplication.sharedApplication().registerForRemoteNotificationTypes(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)
But it doesn't work.
That is my code, working only in iOS 8:
if(UIApplication.instancesRespondToSelector(Selector("registerUserNotificationSettings:"))) {
UIApplication.sharedApplication().registerUserNotificationSettings(UIUserNotificationSettings(forTypes: .Alert | .Sound, categories: nil))
}
else {
}