Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to listen for notification dismissed event in iOS?

I am listneing to actions pressed for my local notifications, but is there a way to determine when the user dismisses a notification?

Here is how I'm listening to my actions in my AppDelegate, but the dismiss doesn't fire this:

func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification, completionHandler: () -> Void) {
        var actionName: String? = nil

        if let identifier = identifier {
            switch identifier {
                case "snoozeAction":
                    actionName = "snoozeActionTapped"
                    break
                default: break
            }

            if let name = actionName {
                NSNotificationCenter.defaultCenter().postNotificationName(name, object: nil)
            }
        }

        completionHandler()
    }
like image 294
TruMan1 Avatar asked May 10 '15 16:05

TruMan1


People also ask

How do I read a dismissed notification on my iPhone?

How Do I See Deleted Notifications? Unfortunately, there is no way to view notifications once you've deleted them. If you delete, clear, or open one, it will no longer appear on your iPhone's lock screen, and there's no way to retrieve it.

How do you hear all notifications on iPhone?

Go to Settings > Sounds & Haptics (on supported models) or Sounds (other models). Tap Text Tone, then do one of the following: Tap Vibration, then choose an option. Tap a sound below Alert Tones.

How do you unmute notifications on IOS 15?

swipe down the screen and find that notification. left swipe the notification and tap "option" choose "Unmute"


1 Answers

Dismissing a notification does not wake your application up so there is no way to capture this.

like image 59
quantumkid Avatar answered Nov 01 '22 11:11

quantumkid