BUBasicController Class Reference
Inherits from | NSObject |
---|---|
Declared in | BUBasicController.h |
Overview
Use the device screen to perform a BlinkUp
The BUBasicController is a convienance class that handles the normal operation of a BlinkUp using the standard BlinkUp user experience. A new BUBasicController should be created for each BlinkUp attempt.
If you wish to have a more customized approach please create the BUNetworkSelectController, BUConfigId, BUFlashController, and the BUDevicePoller as individual objects.
– init
Please use initWithApiKey:
- (nonnull instancetype)init
Return Value
An Exception will be thrown
Discussion
Please use initWithApiKey:
Declared In
BUBasicController.h
– initWithApiKey:
Default Initializer
- (nonnull instancetype)initWithApiKey:(nonnull NSString *)apiKey
Parameters
apiKey |
The APIKey assigned to you from Electric Imp |
---|
Return Value
An initialized BlinkUpController
Declared In
BUBasicController.h
– initWithApiKey:planId:
Initial with an existing planId
- (nonnull instancetype)initWithApiKey:(nonnull NSString *)apiKey planId:(nonnull NSString *)planId
Parameters
apiKey |
The APIKey assigned to you from Electric Imp |
---|---|
planId |
An existing planId to use for the configuration |
Return Value
An initialized BlinkUpController
Declared In
BUBasicController.h
– presentInterfaceAnimated:resignActive:devicePollingDidComplete:
Show standard network selection screen
if you want to use an existing PlanID, the BlinkUpController’s planId property must be set. If planId is nil (or not set), this method will automatically fetch a new planId. Most developers won’t need to reuse existing planIDs. Please contact support if you have questions.
If using Swift and want enumerated results, please use the Swift extension method
- (void)presentInterfaceAnimated:(BOOL)animated resignActive:(nullable BUResignActiveBlock)resignActive devicePollingDidComplete:(nullable BUDevicePollingDidCompleteBlock)devicePollingDidComplete
Parameters
animated |
Should the presentation be animated |
---|---|
resignActive |
Block that is executed when the BlinkUp screen is dismissed and control is returned to the presenting screen |
devicePollingDidComplete |
Block that is executed when the device connection attempt is complete (success or failure) |
Declared In
BUBasicController.h
– forceDismissWithCompletionHandler:
Dismiss the BUBasicController
Dismiss the view controller and return control to the presenting view controller. If this method is called the resignActive and devicePollingDidComplete completion handlers will not be called. This method only needs to be called if you wish to force the end of the user interaction.
- (void)forceDismissWithCompletionHandler:(void ( ^ _Nullable ) ( void ))completionHandler
Parameters
completionHandler |
Block called after the view controller is dismissed |
---|
Declared In
BUBasicController.h
networkSelectController
An interface for network selection by the user
@property (strong, nonatomic, readonly, nonnull) BUNetworkSelectController *networkSelectController
Declared In
BUBasicController.h
flashController
An interface that performs the BlinkUp flashing operations
@property (strong, nonatomic, readonly, nonnull) BUFlashController *flashController
Declared In
BUBasicController.h
devicePoller
Gather device metadata after a flash
@property (strong, nonatomic, readonly, nullable) BUDevicePoller *devicePoller
Declared In
BUBasicController.h