1

I want to know how to fire continuous local notification in ios (Swift), I run the local notification code in for loop but, when I terminate the app it will not execute full code.

1 Answers1

1

Try the following:

let content = UNMutableNotificationContent()
content.title = "Hello"
content.body = "World"
content.badge = 1
content.sound = UNNotificationSound.default
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 60, repeats: true)
let request = UNNotificationRequest(identifier: "", content: content, trigger: trigger)
UNUserNotificationCenter.current().add(request, withCompletionHandler: nil)
Arik Segal
  • 2,963
  • 2
  • 17
  • 29