@@ -10,6 +10,7 @@ class IterableUserDefaults {
10
10
self . userDefaults = userDefaults
11
11
}
12
12
13
+ // migrated to IterableKeychain
13
14
var userId : String ? {
14
15
get {
15
16
string ( withKey: . userId)
@@ -18,6 +19,7 @@ class IterableUserDefaults {
18
19
}
19
20
}
20
21
22
+ // migrated to IterableKeychain
21
23
var email : String ? {
22
24
get {
23
25
string ( withKey: . email)
@@ -26,6 +28,7 @@ class IterableUserDefaults {
26
28
}
27
29
}
28
30
31
+ // migrated to IterableKeychain
29
32
var authToken : String ? {
30
33
get {
31
34
string ( withKey: . authToken)
@@ -34,6 +37,7 @@ class IterableUserDefaults {
34
37
}
35
38
}
36
39
40
+ // deprecated, not in use anymore
37
41
var ddlChecked : Bool {
38
42
get {
39
43
bool ( withKey: . ddlChecked)
@@ -74,14 +78,18 @@ class IterableUserDefaults {
74
78
try ? save ( codable: attributionInfo, withKey: . attributionInfo, andExpiration: expiration)
75
79
}
76
80
81
+ // migrated to IterableKeychain
77
82
func getPayload( currentDate: Date ) -> [ AnyHashable : Any ] ? {
78
83
( try ? dict ( withKey: . payload, currentDate: currentDate) ) ?? nil
79
84
}
80
85
86
+ // migrated to IterableKeychain
81
87
func save( payload: [ AnyHashable : Any ] ? , withExpiration expiration: Date ? ) {
82
88
try ? save ( dict: payload, withKey: . payload, andExpiration: expiration)
83
89
}
84
90
91
+ // MARK: data migration functions
92
+
85
93
func getLastPushPayloadExpirationPairForMigration( ) -> ( payload: [ AnyHashable : Any ] ? , expiration: Date ? ) ? {
86
94
guard let encodedEnvelope = userDefaults. value ( forKey: UserDefaultsKey . payload. value) as? Data else {
87
95
return nil
0 commit comments