I am developing a webRTC (video calling) application in ios. I am receiving a APNS push notification from server,whenever user receive a incoming video call on the device.
{
"aps" : {
"alert" : "Incoming video call from - Bob",
"badge" : 1,
"sound" : "bingbong.mp3",
"userdata" : {JSON}
}
}
How can I store it inside Local Notification?
If you want to store data in local push notification then you can add the data like this,
let interval = TimeInterval(1)
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: interval, repeats: false)
let content = UNMutableNotificationContent()
content.title = "Incoming video call from - Bob"
content.body = "Your body"
content.sound = UNNotificationSound.init(named: "CustomSound.mp3")
content.badge = "Your badge number"
content.userInfo = ["userData": YOUR_USER_DATA from remote]
let req = UNNotificationRequest(identifier: "localPushNotification", content: content, trigger: trigger)
let center = UNUserNotificationCenter.current()
center.add(req, withCompletionHandler: nil)