File tree Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import Foundation
6
6
7
+ extension IterableAuthDelegate {
8
+ func onTokenRegistrationFailed( _ reason: String ? = nil ) {
9
+
10
+ }
11
+ }
12
+
7
13
class AuthManager : IterableAuthManagerProtocol {
8
14
init ( delegate: IterableAuthDelegate ? ,
9
15
expirationRefreshPeriod: TimeInterval ,
@@ -96,7 +102,7 @@ class AuthManager: IterableAuthManagerProtocol {
96
102
pendingAuth = false
97
103
98
104
guard authToken != nil else {
99
- delegate? . onTokenRegistrationFailed ( )
105
+ delegate? . onTokenRegistrationFailed ( " auth token was nil, scheduling auth token retrieval in 10 seconds " )
100
106
101
107
/// by default, schedule a refresh for 10s
102
108
scheduleAuthTokenRefreshTimer ( 10 )
@@ -119,7 +125,7 @@ class AuthManager: IterableAuthManagerProtocol {
119
125
clearRefreshTimer ( )
120
126
121
127
guard let authToken = authToken, let expirationDate = AuthManager . decodeExpirationDateFromAuthToken ( authToken) else {
122
- delegate? . onTokenRegistrationFailed ( )
128
+ delegate? . onTokenRegistrationFailed ( " auth token was nil or could not decode an expiration date, scheduling auth token retrieval in 10 seconds " )
123
129
124
130
/// schedule a default timer of 10 seconds if we fall into this case
125
131
scheduleAuthTokenRefreshTimer ( 10 )
Original file line number Diff line number Diff line change @@ -55,13 +55,7 @@ import Foundation
55
55
/// The delegate for getting the authentication token
56
56
@objc public protocol IterableAuthDelegate : AnyObject {
57
57
@objc func onAuthTokenRequested( completion: @escaping AuthTokenRetrievalHandler )
58
- @objc func onTokenRegistrationFailed( )
59
- }
60
-
61
- extension IterableAuthDelegate {
62
- func onTokenRegistrationFailed( ) {
63
-
64
- }
58
+ @objc func onTokenRegistrationFailed( _ reason: String ? )
65
59
}
66
60
67
61
/// Iterable Configuration Object. Use this when initializing the API.
Original file line number Diff line number Diff line change @@ -646,7 +646,7 @@ class AuthTests: XCTestCase {
646
646
}
647
647
}
648
648
649
- func onTokenRegistrationFailed( ) {
649
+ func onTokenRegistrationFailed( _ reason : String ? ) {
650
650
651
651
}
652
652
}
@@ -678,7 +678,7 @@ class AuthTests: XCTestCase {
678
678
completion ( AuthTests . authToken)
679
679
}
680
680
681
- func onTokenRegistrationFailed( ) {
681
+ func onTokenRegistrationFailed( _ reason : String ? ) {
682
682
683
683
}
684
684
}
@@ -729,7 +729,7 @@ class AuthTests: XCTestCase {
729
729
}
730
730
}
731
731
732
- func onTokenRegistrationFailed( ) {
732
+ func onTokenRegistrationFailed( _ reason : String ? ) {
733
733
734
734
}
735
735
}
@@ -867,7 +867,7 @@ class AuthTests: XCTestCase {
867
867
completion ( authTokenGenerator ( ) )
868
868
}
869
869
870
- func onTokenRegistrationFailed( ) {
870
+ func onTokenRegistrationFailed( _ reason : String ? ) {
871
871
872
872
}
873
873
}
You can’t perform that action at this time.
0 commit comments