BUConfigId Class Reference
Inherits from | NSObject |
---|---|
Declared in | BUConfigId.h |
Overview
Identifier of the device configuration session
The ConfigId is used as a unique token that represents a single configuration of a device. It is created by the Electric Imp servers and should only be used for a single configuration session. On subsequent configuration attempts (even on the same device) a new ConfigId should be used.
– initWithApiKey:completionHandler:
Initialize using a new plan ID
If you are using Swift and want enumerated results, please use the Swift extension method
- (nonnull instancetype)initWithApiKey:(nonnull NSString *)apiKey completionHandler:(nullable BUConfigIdCompletionHandler)completionHandler
Parameters
apiKey |
The API Key assigned to you from Electric Imp |
---|---|
completionHandler |
Block called when the configuration ID is retrieved from the Electric Imp server. If error is nil, then the ConfigId has been succesfully activated |
Return Value
ConfigId that may or may not be active
Declared In
BUConfigId.h
– init
This method should never be used
- (nonnull instancetype)init
Return Value
Do not use
Declared In
BUConfigId.h
– initWithApiKey:planId:completionHandler:
Initialize using an existing plan ID
If you are using Swift and want enumerated results, please use the Swift extension method
- (nonnull instancetype)initWithApiKey:(nonnull NSString *)apiKey planId:(nullable NSString *)planId completionHandler:(nullable BUConfigIdCompletionHandler)completionHandler
Parameters
apiKey |
The API Key assigned to you from Electric Imp |
---|---|
planId |
If you are setting the planId property, it must be an existing ID previously generated by Electric Imp |
completionHandler |
Block called when the configuration ID is retrieved from the Electric Imp server. If error is nil, then the ConfigId has been succesfully activated |
Return Value
ConfigId that may or may not be active
Declared In
BUConfigId.h
apiKey
Retrieve the API Key that is used when retrieving the ConfigId
@property (nonatomic, readonly, nullable) NSString *apiKey
Declared In
BUConfigId.h
planId
Retrieve the plan ID that is used for configuring the device
If you are setting the planId property, it must be an existing ID previously generated by Electric Imp
@property (nonatomic, readonly, nullable) NSString *planId
See Also
FAQ for an explanation of what the plan ID is
Declared In
BUConfigId.h
token
One-time configuration token
The token is retrieved from the Electric Imp servers and identifies the short-term configuration transaction between the server and the device
@property (nonatomic, readonly, nonnull) NSString *token
Declared In
BUConfigId.h
isActive
Indicates if the ConfigId has been retrieved from the server
This property is true
when the ConfigId is ready to be used. If it is false
the ID has not been retrieved yet, or there was an error (be sure to check
for error in the initialization methods completion handler)
@property (nonatomic, readonly) BOOL isActive
Declared In
BUConfigId.h