Notification Model

PHOTO EMBED

Fri Jul 07 2023 10:15:32 GMT+0000 (Coordinated Universal Time)

Saved by @hasnat #ios #swift #notification #model

import Foundation

class NotificationModel {
    
    var body = ""
    var senderId = ""
    var receiverId = ""
    var notificationId = ""
    var serviceProviderId = ""
    var timestamp = 0
    var title = ""
    var date = ""
    
    init(notification : [String:Any]) {
        
        self.body = notification["body"] as? String ?? ""
        self.senderId = notification["senderId"] as? String ?? ""
        self.receiverId = notification["receiverId"] as? String ?? ""
        self.notificationId = notification["notificationId"] as? String ?? ""
        self.serviceProviderId = notification["serviceProviderId"] as? String ?? ""
        self.title = notification["title"] as? String ?? ""
        self.date = notification["date"] as? String ?? ""
        self.timestamp = notification["timestamp"] as? Int ?? 0
    }
}
content_copyCOPY