Skip to content

Commit 1852efc

Browse files
No need to update device id on init.
1 parent cc1b510 commit 1852efc

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

swift-sdk/Internal/IterableAPIInternal.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ final class IterableAPIInternal : NSObject, PushTrackerProtocol {
128128
}
129129
if let deviceId = localStorage.deviceId {
130130
dataFields[deviceKeys.deviceId] = deviceId
131+
} else {
132+
let deviceId = IterableUtil.generateUUID()
133+
localStorage.deviceId = deviceId
134+
dataFields[deviceKeys.deviceId] = deviceId
131135
}
132136
if let sdkVersion = localStorage.sdkVersion {
133137
dataFields[deviceKeys.iterableSdkVersion] = sdkVersion
@@ -701,8 +705,7 @@ final class IterableAPIInternal : NSObject, PushTrackerProtocol {
701705
// super initlog
702706
super.init()
703707

704-
// device id and sdk version
705-
updateDeviceId()
708+
// sdk version
706709
updateSDKVersion()
707710

708711
// check for deferred deeplinking
@@ -796,12 +799,6 @@ final class IterableAPIInternal : NSObject, PushTrackerProtocol {
796799
localStorage.ddlChecked = true
797800
}
798801

799-
private func updateDeviceId() {
800-
if localStorage.deviceId == nil {
801-
localStorage.deviceId = IterableUtil.generateUUID()
802-
}
803-
}
804-
805802
private func updateSDKVersion() {
806803
if let lastVersion = localStorage.sdkVersion, lastVersion != IterableAPI.sdkVersion {
807804
performUpgrade(lastVersion: lastVersion, newVersion: IterableAPI.sdkVersion)

0 commit comments

Comments
 (0)