I have an app that requests from the user push notifications. This is shown on a separate view controller with a bit of extra information explaining why we need to enable PN.
There is a segue set up to push to the next view however I would like to perform the segue only after the user has selected don't allow or OK on the popup.
I have tried using
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(NotificationViewController.notificationsSet), name: "pushNotificationMessage", object: nil)
and
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
let tokenChars = UnsafePointer<CChar>(deviceToken.bytes)
var tokenString = ""
for i in 0 ..< deviceToken.length
{
tokenString += String(format: "%02.2hhx", arguments: [tokenChars[i]])
}
NSNotificationCenter.defaultCenter().postNotification(NSNotification(name: "pushNotificationMessage", object: nil))
}
but this sends the notification immediately after the view is loaded.
Is there a way to pause on a view until the user responds to the message?
Thanks