ARTTokenParams
Objective-C
@interface ARTTokenParams : NSObject <NSCopying>
Swift
class ARTTokenParams : NSObject, NSCopying
Defines the properties of an Ably Token.
-
Requested time to live for the token in milliseconds. The default is 60 minutes.
Declaration
Objective-C
@property (nonatomic, nullable) NSNumber *ttl;Swift
var ttl: NSNumber? { get set } -
The capabilities associated with this Ably Token. The capabilities value is a JSON-encoded representation of the resource paths and associated operations. Read more about capabilities in the capabilities docs.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *capability;Swift
var capability: String? { get set } -
A client ID, used for identifying this client when publishing messages or for presence purposes. The
clientIdcan be any non-empty string, except it cannot contain a*. This option is primarily intended to be used in situations where the library is instantiated with a key. Note that aclientIdmay also be implicit in a token used to instantiate the library. An error is raised if aclientIdspecified here conflicts with theclientIdimplicit in the token. Find out more about identified clients.Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *clientId;Swift
var clientId: String? { get set } -
The timestamp of this request as
NSDateobject. Timestamps, in conjunction with thenonce, are used to prevent requests from being replayed.timestampis a “one-time” value, and is valid in a request, but is not validly a member of any default token params such asARTClientOptions.defaultTokenParams.Declaration
Objective-C
@property (nonatomic, copy, nullable) NSDate *timestamp;Swift
var timestamp: Date? { get set } -
A cryptographically secure random string of at least 16 characters, used to ensure the
ARTTokenRequestcannot be reused.Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSString *nonce;Swift
var nonce: String? { get }
-
Undocumented
Declaration
Objective-C
- (ARTTokenRequest *)sign:(NSString *)key;Swift
func sign(_ key: String!) -> ARTTokenRequest! -
Undocumented
Declaration
Objective-C
- (ARTTokenRequest *)sign:(NSString *)key withNonce:(NSString *)nonce;Swift
func sign(_ key: String!, withNonce nonce: String!) -> ARTTokenRequest!