Change the body content on Repeated notification

Hi, I am developing an app especially for Notifiction . I need local repeated notifcation that has to change the body content of the Notifcation. I tried and searched in many forums , but not found any replies . Please any one help me to update my content on repeated local notification. This is my code snippet , repeating notification set interval to 2 minutes.

 

 

let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 2, repeats: true)

let content = UNMutableNotificationContent()
        content.title = NSString.localizedUserNotificationString(forKey: "Notification Title", arguments: nil)
        content.body = NSString.localizedUserNotificationString(forKey: message, arguments: nil)
        content.sound = UNNotificationSound.init(named: "notification.mp3")
        content.userInfo=descriptions

let request = UNNotificationRequest(identifier: indentifier, content: content, trigger: trigger)
       
        center.add(request, withCompletionHandler: {
            (errorObject) in 
            if let error = errorObject{
                print("Error (error.localizedDescription) in notification (indentifierreassign)")
            }else{
                
            }
        })


Powered by WPeMatico

About

You may also like...

Comments are closed.