EMTokenManager

Objective-C

@protocol EMTokenManager <NSObject>

Swift

protocol EMTokenManager : NSObjectProtocol

The manager to create and retrieve tokens.

  • Returns the names of available tokens. An empty set is returned if no token is found.

    Declaration

    Objective-C

    - (NSSet<NSString *> *)tokenNames:(NSError **)error;

    Swift

    func tokenNames() throws -> Set<String>

    Parameters

    error

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    The available token names as a set of NSString.

  • Removes an existing token.

    Declaration

    Objective-C

    - (BOOL)removeTokenWithName:(NSString *)name error:(NSError **)error;

    Swift

    func removeToken(withName name: String!) throws

    Parameters

    name

    The token name.

    error

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    YES if it existed and was removed, otherwise NO.

  • Removes an existing token.

    Declaration

    Objective-C

    - (BOOL)removeToken:(id<EMToken>)token error:(NSError **)error;

    Swift

    func remove(_ token: (any EMToken)!) throws

    Parameters

    token

    The token to remove

    error

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    YES if it existed and was removed, otherwise NO.