@@ -17,7 +17,7 @@ public enum NotificationType {
17
17
case accountLogout
18
18
case accountErased
19
19
case accountDeactivated
20
- case unknown
20
+ case defaultNotification ( type : String )
21
21
}
22
22
23
23
/// InPlayer Notification
@@ -37,7 +37,7 @@ public struct InPlayerNotification: Codable {
37
37
static let accountLogout = " account.logout "
38
38
static let accountErased = " account.erased "
39
39
static let accountDeactivated = " account.deactivated "
40
- static let unknown = " unknown "
40
+ static let defaultNotification = " default "
41
41
}
42
42
43
43
/// Decoder method
@@ -60,11 +60,7 @@ public struct InPlayerNotification: Codable {
60
60
case NotificationTypeStrings . accountDeactivated:
61
61
type = . accountDeactivated
62
62
default :
63
- type = . unknown
64
- let error = NSError ( domain: " Error " ,
65
- code: 0 ,
66
- userInfo: [ NSLocalizedDescriptionKey: " Unsupported notification type " ] )
67
- throw error
63
+ type = . defaultNotification( type: typeString)
68
64
}
69
65
}
70
66
@@ -86,7 +82,7 @@ public struct InPlayerNotification: Codable {
86
82
case . accountDeactivated:
87
83
try values. encode ( NotificationTypeStrings . accountDeactivated, forKey: . typeString)
88
84
default :
89
- try values. encode ( NotificationTypeStrings . unknown , forKey: . typeString)
85
+ try values. encode ( NotificationTypeStrings . defaultNotification , forKey: . typeString)
90
86
}
91
87
}
92
88
}
0 commit comments