i have use the single notification , and this is my code: this is for register the local notification>>>
func registerLocal() {
let center = UNUserNotifi
Call this function with different parameters. Like i called when app goes background
func applicationDidEnterBackground(_ application: UIApplication) {
setNotification(time: 25,identifier: "notific2")
setNotification(time: 50,identifier: "notific3")
setNotification(time: 90,identifier: "notific4")
}
func setNotification (time : Int,identifier : String)
{
let content = UNMutableNotificationContent()
content.title = "Don't forget"
content.body = "Buy some milk"
content.sound = UNNotificationSound.default()
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: TimeInterval(time),
repeats: false)
let center = UNUserNotificationCenter.current()
// Swift
let request = UNNotificationRequest(identifier: identifier,
content: content, trigger: trigger)
center.add(request, withCompletionHandler: { (error) in
if error != nil {
// Something went wrong
}
})
}