My iOS app sets a local notification that only goes off if the app is in the background.
When the user selects this local notification it brings the app back to the foreground.
Is it possible to subscribe to an event in NotificationCenter to handle the event of the user coming from this specific path maybe through a standard UIApplicationmethod?
If not, what is the best way to handle the specific event where a user taps a local notification ideally in the ViewController presented on foregrounding in Swift 5?
Create a delegate object that adopts the
UNUserNotificationCenterDelegateprotocol and implement theuserNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:methods.Assign this object to the delegate property of the singleton
UNUserNotificationCenterobject.Do this in you
AppDelegatedidFinishLaunchingmethodAdditional doc : https://developer.apple.com/documentation/usernotifications/unusernotificationcenter