So, I’ve got the following local notification in my game…
let localNotification:UILocalNotification = UILocalNotification()
localNotification.alertAction = "Battle"
localNotification.alertBody = "You've encountered a battle!"
localNotification.fireDate = NSDate(timeIntervalSinceNow: 60)
What I’d like to do is change a BOOL value to true when this notification fires. So after 60 seconds the notification happens and at that moment a BOOL goes from false to true.
I want this to happen regardless of whether the user has even read the notification.
To give a bit of context the notification is to notify the user that they’ve encountered a battle and I want the battle screen to pop up the next time they open the app regardless of whether they open the app using the notification or just by tapping the icon the traditional way. I can do this if I can just figure out how to toggle the BOOL value at the same time the notification goes off.