Skip to content

Commit a0dcf3d

Browse files
authored
Merge pull request #606 from Iterable/jay/MOB-5741-get-auth-token
[MOB-5741] add way to read current auth token
2 parents 375db1c + 104f014 commit a0dcf3d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

swift-sdk/Internal/InternalIterableAPI.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
2424
}
2525
}
2626

27+
var authToken: String? {
28+
get {
29+
authManager.getAuthToken()
30+
}
31+
}
32+
2733
var deviceId: String {
2834
if let value = localStorage.deviceId {
2935
return value

swift-sdk/IterableAPI.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ public final class IterableAPI: NSObject {
2828
}
2929
}
3030

31+
/// The current authentication token
32+
public static var authToken: String? {
33+
get {
34+
internalImplementation?.authToken
35+
}
36+
}
37+
3138
/// The `userInfo` dictionary which came with last push
3239
public static var lastPushPayload: [AnyHashable: Any]? {
3340
internalImplementation?.lastPushPayload

0 commit comments

Comments
 (0)