Home > Blockchain >  iOS How to open Push Notification "link" when app is killed in swift
iOS How to open Push Notification "link" when app is killed in swift

Time:04-13

I want to click push notification and open "link" when app is Killed Where should I control when the app is killed? And how can I open the "link"? Also works in foreground and background

CodePudding user response:

There is no control for push notifications while App is killed, after clicking on Notification

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void)

the method will be called and you can open your link, according to your notification type.

CodePudding user response:

You can also use this method and fetch your notification.

    func userNotificationCenter(_: UNUserNotificationCenter, willPresent _: UNNotification, withCompletionHandler _: @escaping (UNNotificationPresentationOptions) -> Void) {}

let me know if it's work.

  • Related