SPLocationManagerDelegate
Objective-C
@protocol SPLocationManagerDelegate <NSObject>
Swift
protocol SPLocationManagerDelegate : NSObjectProtocol
Delegate for SPLocationManager. Use this to listen for location related callbacks.
-
Called when device bluetooth state changes. You may want to listen to this callback and prompt the user to enable bluetooth if necessary.
Declaration
Objective-C
- (void)spLocationManager:(nonnull SPLocationManager *)manager bluetoothStateChanged:(SPBluetoothState)state;Swift
optional func spLocationManager(_ manager: SPLocationManager, bluetoothStateChanged state: SPBluetoothState)Parameters
managerobject that called this method
statenew bluetooth state
-
Called when user’s location changes.
Declaration
Objective-C
- (void)spLocationManager:(nonnull SPLocationManager *)manager didUpdateLocation:(nonnull SPLocation *)location;Swift
optional func spLocationManager(_ manager: SPLocationManager, didUpdate location: SPLocation)Parameters
managerobject that called this method
locationcurrent location
-
Called when an NDD file has been loaded.
Declaration
Objective-C
- (void)spLocationManager:(nonnull SPLocationManager *)manager didLoadNDD:(BOOL)success error:(nullable NSError *)error;Swift
optional func spLocationManager(_ manager: SPLocationManager, didLoadNDD success: Bool, error: Error?)Parameters
managerobject that called this method
successtrue if NDD was loaded successfully
errorreturned if loading failed
-
Called periodically when the location manager detects nearby beacons. Contains a maximum of 10 nearest beacons. Note that this does not affect positioning and is merely available to provide extra information about nearby beacons.
Declaration
Objective-C
- (void)spLocationManager:(nonnull SPLocationManager *)manager detectedNearbyBeacons:(nonnull NSArray<NSString *> *)beacons;Swift
optional func spLocationManager(_ manager: SPLocationManager, detectedNearbyBeacons beacons: [String])Parameters
managerobject that called this method
beaconslist containing nearby beacons. List may be empty
SPLocationManagerDelegate Protocol Reference