SPLocationManagerDelegate

@protocol SPLocationManagerDelegate <NSObject>

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

    manager

    object that called this method

    state

    new 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

    manager

    object that called this method

    location

    current 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

    manager

    object that called this method

    success

    true if NDD was loaded successfully

    error

    returned 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

    manager

    object that called this method

    beacons

    list containing nearby beacons. List may be empty