The O.G. Virtual learning! Buy one, get 2 more Lifetime Memberships! - Click Here!

Local Notification question

Home 4 Forums Swift and Sprite Kit Local Notification question


This topic contains 0 replies, has 1 voice, and was last updated by  Andrew Jarrell 4 years, 10 months ago.

  • June 21, 2016 at 1:47 pm #151925

    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.

    Any ideas?

You must be logged in to reply to this topic.

Know what an affiliate program is? You make money just by sharing links to our site! Win. Win.

Earn when you refer any buyer here! 30 day tracking. Commissions are 33%-50% and recur on subscription products!

Uh oh, missing your affiliate ID. Create one real quick