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 3 years, 4 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.

Become part of the CartoonSmart Team with our Affiliate Program

Make recurring money when you refer a subscriber. 30 day tracking. Commissions 33%-50%!

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