Add push notifications
This commit is contained in:
21
CHDataManagement/Notifications/NotificationRequest.swift
Normal file
21
CHDataManagement/Notifications/NotificationRequest.swift
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
struct NotificationRequest {
|
||||
|
||||
let accessToken: String
|
||||
|
||||
/// The notificiations in the available languages
|
||||
let notifications: [String : WebNotification]
|
||||
|
||||
init(accessToken: String, notifications: [String : WebNotification]) {
|
||||
self.accessToken = accessToken
|
||||
self.notifications = notifications
|
||||
}
|
||||
|
||||
func notification(for language: String) -> WebNotification? {
|
||||
notifications[language] ?? notifications["en"]
|
||||
}
|
||||
}
|
||||
|
||||
extension NotificationRequest: Codable {
|
||||
|
||||
}
|
Reference in New Issue
Block a user