CommunicationTokenCredential
@objcMembers
public class CommunicationTokenCredential : NSObject, CancellableThe Azure Communication Services User token credential. This class is used to cache/refresh the access token required by Azure Communication Services.
- 
                  
                  Creates a static CommunicationTokenCredentialobject from the provided token.Throws NSErrorif the provided token is not a valid user token.userInfocontainsmessagekey for reason.DeclarationSwift public init(token: String) throwsParameterstokenThe static token to use for authenticating all requests. 
- 
                  
                  Creates a CommunicationTokenCredential that automatically refreshes the token. Throws NSErrorif the provided token is not a valid user token.userInfocontainsmessagekey for reason.DeclarationSwift public init(withOptions options: CommunicationTokenRefreshOptions) throwsParametersoptionsOptions for how the token will be refreshed 
- 
                  
                  Retrieve an access token from the credential. DeclarationSwift public func token(completionHandler: @escaping CommunicationTokenCompletionHandler)ParameterscompletionHandlerClosure that accepts an optional AccessTokenor optionalErroras parameters.AccessTokenreturns a token and an expiry date if applicable.Errorreturnsnilif the current token can be returned.
- 
                  
                  Disposes the CommunicationTokenCredential and cancels any internal auto-refresh operation. DeclarationSwift public func cancel()
 View on GitHub
            View on GitHub
          