CBLHotspotHelpers
Objective-C
@interface CBLHotspotHelpers : NSObject
Swift
class HotspotHelpers : NSObject
The CBLHotspotHelpers class contains logic for connecting the host device to the given WiFi network.
-
The shared object.
Declaration
Objective-C
@property (class, nonatomic, readonly, nonnull) CBLHotspotHelpers *sharedInstance;Swift
class var shared: HotspotHelpers { get } -
Returns
YESif location permission is required to connect to a WiFi network, otherwiseNO.Declaration
Objective-C
@property (class, nonatomic, readonly) BOOL requiresLocationPermission;Swift
class var requiresLocationPermission: Bool { get } -
Attempt to join the given WiFi network.
Note
Joining a WiFi network can take upwards of 20-30 seconds.
Declaration
Objective-C
- (void)attemptToJoinWiFiNetwork:(NSString *_Nonnull)ssid password:(NSString *_Nonnull)password promptingForLocationIfNeeded:(BOOL)promptForLocation completionHandler: (CBLHotspotCompletion _Nonnull)completionHandler completionQueue:(dispatch_queue_t _Nonnull)completionQueue;Swift
func attemptToJoinWiFiNetwork(_ ssid: String, password: String, promptingForLocationIfNeeded promptForLocation: Bool, completionHandler: @escaping HotspotCompletion, completionQueue: dispatch_queue_t)Parameters
ssidThe SSID of the network to join.
passwordThe password of the network to join.
promptForLocationIf the current platform requires location permission to connect to a network, pass
YESto automatically prompt for that permission if needed.completionHandlerThe completion handler to call upon success or failure.
completionQueueThe queue on which to call the completion handler.
-
Attempt to join the WiFi network described by the given QR code scanning result. See
id <CBLCameraQRDecoding>for details.Note
Joining a WiFi network can take upwards of 20-30 seconds.
Declaration
Objective-C
- (void)attemptToJoinQRCodeNetwork: (CBLCameraWiFiDetails *_Nonnull)networkDetails promptingForLocationIfNeeded:(BOOL)promptForLocation completionHandler: (CBLHotspotCompletion _Nonnull)completionHandler completionQueue:(dispatch_queue_t _Nonnull)completionQueue;Swift
func attemptToJoinQRCodeNetwork(_ networkDetails: CameraWiFiDetails, promptingForLocationIfNeeded promptForLocation: Bool, completionHandler: @escaping HotspotCompletion, completionQueue: dispatch_queue_t)Parameters
networkDetailsThe details of the network to join.
promptForLocationIf the current platform requires location permission to connect to a network, pass
YESto automatically prompt for that permission if needed.completionHandlerThe completion handler to call upon success or failure.
completionQueueThe queue on which to call the completion handler.