Skip to content

Commit 0678d8e

Browse files
committed
comment on specific fields in defaults
1 parent f7bd555 commit 0678d8e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

swift-sdk/Internal/IterableUserDefaults.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class IterableUserDefaults {
1010
self.userDefaults = userDefaults
1111
}
1212

13+
// migrated to IterableKeychain
1314
var userId: String? {
1415
get {
1516
string(withKey: .userId)
@@ -18,6 +19,7 @@ class IterableUserDefaults {
1819
}
1920
}
2021

22+
// migrated to IterableKeychain
2123
var email: String? {
2224
get {
2325
string(withKey: .email)
@@ -26,6 +28,7 @@ class IterableUserDefaults {
2628
}
2729
}
2830

31+
// migrated to IterableKeychain
2932
var authToken: String? {
3033
get {
3134
string(withKey: .authToken)
@@ -34,6 +37,7 @@ class IterableUserDefaults {
3437
}
3538
}
3639

40+
// deprecated, not in use anymore
3741
var ddlChecked: Bool {
3842
get {
3943
bool(withKey: .ddlChecked)
@@ -74,14 +78,18 @@ class IterableUserDefaults {
7478
try? save(codable: attributionInfo, withKey: .attributionInfo, andExpiration: expiration)
7579
}
7680

81+
// migrated to IterableKeychain
7782
func getPayload(currentDate: Date) -> [AnyHashable: Any]? {
7883
(try? dict(withKey: .payload, currentDate: currentDate)) ?? nil
7984
}
8085

86+
// migrated to IterableKeychain
8187
func save(payload: [AnyHashable: Any]?, withExpiration expiration: Date?) {
8288
try? save(dict: payload, withKey: .payload, andExpiration: expiration)
8389
}
8490

91+
// MARK: data migration functions
92+
8593
func getLastPushPayloadExpirationPairForMigration() -> (payload: [AnyHashable: Any]?, expiration: Date?)? {
8694
guard let encodedEnvelope = userDefaults.value(forKey: UserDefaultsKey.payload.value) as? Data else {
8795
return nil

0 commit comments

Comments
 (0)