Background
Since the release of Neura iOS SDK version 4.12.0, the user Access Token (used to pull data through Neura's REST API) is expired and refreshed automatically. If you're using the Access Token, you'll need to update your backend every time it's updated on the client side.
First Step - Implement the NeuraAuthenticationDelegate protocol
Objective-c
@interface YourClass () <NeuraAuthenticationDelegate>
Swift
class YourClass: NSObject, NeuraAuthenticationDelegate {}
Assign your Class Instance to the Authentication Delegate
NeuraSDK.shared.authenticationDelegate = self
Third Step - Implement Optional Method neuraAuthenticationStateChanged
neuraAuthenticationStateChanged is called every time the authenticationState changed.
Objective-c
(void)neuraAuthenticationStateChanged:(NeuraAuthState)newState {
}
Swift
func neuraAuthenticationStateChanged(newState: NeuraAuthState) {
}
Fourth Step - Implement the Optional Method neuraAccessTokenChanged
neuraAccessTokenChanged is called whenever the value of the access token has changed. It will also be called when the access token is deleted (and nil will be passed as newAccessToken value).
Objective-c
(void)neuraAccessTokenChanged:(NSString *)newAccessToken {}
Swift
func neuraAccessTokenChanged(_ newAccessToken: String?) {}
Comments
0 comments
Please sign in to leave a comment.