SCLFlicManagerDelegate Protocol Reference

Conforms to NSObject
Declared in SCLFlicPoicManager.h

Overview

@protocol SCLFlicManagerDelegate

The delegate of a SCLFlicManager instance must adopt the SCLFlicManagerDelegate protocol. There are no required delegate methods, but flicManagerDidChangeBluetoothState is highly recommended.

– flicManager:didDiscoverButton:withRSSI: required method

@method flicManager:didDiscoverButton:withRSSI:

- (void)flicManager:(SCLFlicManager *_Nonnull)manager didDiscoverButton:(SCLFlicButton *_Nonnull)button withRSSI:(NSNumber *_Nullable)RSSI

Parameters

manager

The manager providing this information.

button

The SCLFlicButton object that was generated for the newly found Poic.

RSSI

The RSSI value of the newly found button at the time of discovery.

Discussion

This delegate method is called every time the a new Poic is discovered, the SCLFlicButton object can at this point be used to properly connect the Poic. If you do not wish to keep it at this time, then remember to call forgetButton: on it so that it can be discovered again at a later time. Otherwise it will remain as a known button and can not be discovered again. It will however not be verified as a genuine Poic until after it has been properly connected. Remember that you will only be able to scan for Poics that are owned by your company.

Declared In

SCLFlicPoicManager.h

– flicManager:didGrabFlicButton:withError:

@method flicManager:didGrabFlicButton:withError:

- (void)flicManager:(SCLFlicManager *_Nonnull)manager didGrabFlicButton:(SCLFlicButton *_Nullable)button withError:(NSError *_Nullable)error

Parameters

manager

The manager providing this information.

button

The SCLFlicButton object that was grabbed from the Flic app

error

In case something went wrong while grabbing the Flic this parameter will explain the error.

Discussion

This delegate method is called every time the a new Flic button is grabbed from the Flic App.

Declared In

SCLFlicPoicManager.h

– flicManager:didChangeBluetoothState:

@method flicManager:didChangeBluetoothState:

- (void)flicManager:(SCLFlicManager *_Nonnull)manager didChangeBluetoothState:(SCLFlicManagerBluetoothState)state

Parameters

manager

The manager providing this information.

state

The state that the manager changed to that caused the callback. Notice that there is no guarantee that it has not changed since!

Discussion

If the bluetooth state on the iOS device or the flicManager changes for any reason, then this delegate method will be called letting you that something happened. A parameter state will be included, but it is a good practice to always read the most current value of the bluetoothState property on the manager to get info about the current state, since there is a chance that the state could have changed again while the callback was sent. If the state changes to SCLFlicManagerBluetoothStatePoweredOn then all the previous connections and pending connections will be set back to pending again.

Declared In

SCLFlicPoicManager.h

– flicManagerDidRestoreState:

@method flicManagerDidRestoreState:

- (void)flicManagerDidRestoreState:(SCLFlicManager *_Nonnull)manager

Parameters

manager

The manager providing this information.

Discussion

This delegate method will be called after the manager has been properly restored after being terminated by the system. All the flic buttons that that you had prior to being terminated have been restored as well and this is a good time to collect all the SCLFlicButton objects by using the knownButtons: method in order to properly restore the rest of your application. Do not forget to re-set the delegate on all buttons.

Declared In

SCLFlicPoicManager.h

– flicManager:didForgetButton:error:

@method flicManager:didForgetButton:error:

- (void)flicManager:(SCLFlicManager *_Nonnull)manager didForgetButton:(NSUUID *_Nonnull)buttonIdentifier error:(NSError *_Nullable)error

Parameters

manager

The providing this information.

buttonIdentifier

The buttonIdentifier of the SCLFlicButton object that was cleared

error

In case there was an error

Discussion

This callback will be made when a button has been properly forgotten/removed, unless there was an error. Remember to also remove your references in case you still have any.

Declared In

SCLFlicPoicManager.h