In my app, I want a URL
to run when my notification action is tapped on. The problem is that when I run the app it puts me into the foreground but doesn't run the URL
(I added .foreground
to the notification action). Here is my code:
extension AppDelegate: UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
if response.actionIdentifier == "call" {
if let urled = URL(string: "tel://1234567891") {
UIApplication.shared.open(urled, options: [:])
}
}
}
}
Anyones help would be great:) Thanks for any answers!