SCLFlicButtonDelegate Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | SCLFlicPoicButton.h |
Overview
@protocol SCLFlicButtonDelegate
The delegate of a SCLFlicButton object must adopt the SCLFlicButtonDelegate
protocol. There are not
any required delegate methods, but all are recommended for proper use of the Flic/Poic.
– flicButton:didReceiveButtonDown:age:
@method flicButton:didReceiveButtonDown:age:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didReceiveButtonDown:(BOOL)queued age:(NSInteger)age
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
queued |
This lets you know if the event is a queued event that happened before the Flic/Poic connected or if it is a real time event. |
age |
The age of the trigger event in seconds. This is particularily important when receiving events that might have been queued up on Flic/Poic while it was out of range. The units is in seconds and will be rounded to the nearest second. |
Discussion
The Flic/Poic registered a button down event.
Declared In
SCLFlicPoicButton.h
– flicButton:didReceiveButtonUp:age:
@method flicButton:didReceiveButtonUp:age:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didReceiveButtonUp:(BOOL)queued age:(NSInteger)age
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
queued |
This lets you know if the event is a queued event that happened before the Flic/Poic connected or if it is a real time event. |
age |
The age of the trigger event in seconds. This is particularily important when receiving events that might have been queued up on Flic/Poic while it was out of range. The units is in seconds and will be rounded to the nearest second. |
Discussion
The Flic/Poic registered a button up event.
Declared In
SCLFlicPoicButton.h
– flicButton:didReceiveButtonClick:age:
@method flicButton:didReceiveButtonClick:age:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didReceiveButtonClick:(BOOL)queued age:(NSInteger)age
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
queued |
This lets you know if the event is a queued event that happened before the Flic/Poic connected or if it is a real time event. |
age |
The age of the trigger event in seconds. This is particularily important when receiving events that might have been queued up on Flic/Poic while it was out of range. The units is in seconds and will be rounded to the nearest second. |
Discussion
The Flic/Poic registered a button click event. The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to.
Declared In
SCLFlicPoicButton.h
– flicButton:didReceiveButtonDoubleClick:age:
@method flicButton:didReceiveButtonDoubleClick:age:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didReceiveButtonDoubleClick:(BOOL)queued age:(NSInteger)age
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
queued |
This lets you know if the event is a queued event that happened before the Flic/Poic connected or if it is a real time event. |
age |
The age of the trigger event in seconds. This is particularily important when receiving events that might have been queued up on Flic/Poic while it was out of range. The units is in seconds and will be rounded to the nearest second. |
Discussion
The Flic/Poic registered a button double click event. The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to.
Declared In
SCLFlicPoicButton.h
– flicButton:didReceiveButtonHold:age:
@method flicButton:didReceiveButtonHold:age:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didReceiveButtonHold:(BOOL)queued age:(NSInteger)age
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
queued |
This lets you know if the event is a queued event that happened before the Flic/Poic connected or if it is a real time event. |
age |
The age of the trigger event in seconds. This is particularily important when receiving events that might have been queued up on Flic/Poic while it was out of range. The units is in seconds and will be rounded to the nearest second. |
Discussion
The Flic/Poic registered a button hold event. The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to.
Declared In
SCLFlicPoicButton.h
– flicButtonDidConnect:
@method flicButtonDidConnect:
- (void)flicButtonDidConnect:(SCLFlicButton *_Nonnull)button
Parameters
button |
The SCLFlicButton object that the event came from. |
---|
Discussion
This delegate method is called every time the Flic/Poic physically connected to the iOS device, regardless of the reason for it.
Keep in mind that you also have to wait for the flicButtonIsReady:
before the Flic/Poic is ready for use.
The connectionState
is not guaranteed to switch to SCLFlicButtonConnectionStateConnected
until
after the flicButtonIsReady:
callback has arrived.
Declared In
SCLFlicPoicButton.h
– flicButtonIsReady:
@method flicButtonIsReady:
- (void)flicButtonIsReady:(SCLFlicButton *_Nonnull)button
Parameters
button |
The SCLFlicButton object that the event came from. |
---|
Discussion
This delegate method is called every time the Flic/Poic has sucessfully connected and the autheticity has been verified.
You will not receive any press events from the Flic/Poic before this callback has been sent. Typically this event will be sent
immediately after the flicButtonDidConnect:
event. The verification process will take longer time the very
first time that the Poic (only Poic) is connected to the particular iOS device since a round-trip to the backend server has to
be completed. This also means that an active internet connection is needed during the first connect of the Poic.
Declared In
SCLFlicPoicButton.h
– flicButton:didDisconnectWithError:
@method flicButton:didDisconnectWithError:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didDisconnectWithError:(NSError *_Nullable)error
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
error |
The error that caused the disconnect. If the disconnect was intentional, then the parameter will be nil. |
Discussion
This delegate method is called every time the Flic/Poic has disconnected, regardless of the reason for it. This can sometimes be called during a connection event that failed before the user was notified of the connection.
Declared In
SCLFlicPoicButton.h
– flicButton:didFailToConnectWithError:
@method flicButton:didFailToConnectWithError:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didFailToConnectWithError:(NSError *_Nullable)error
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
error |
The error that caused the Flic/Poic to fail to connect. |
Discussion
The requested connection failed. Please note that depending on at what point in the connection process the connection
failed you might also receive a regular flicButtonDidDisconnect: as well. If the connection fails and this callback is
made then the Flic/Poic will always cancel the pending connection, regardless of what mode the Flic/Poic happens to be in.
This means that if you get a flicButton:didFailToConnectWithError:
event and the Flic/Poic is in Background mode then you
need to call the connect:
yourself to activate the pending connection once again.
Declared In
SCLFlicPoicButton.h
– flicButton:didUpdateRSSI:error:
@method flicButton:didUpdateRSSI:error:
- (void)flicButton:(SCLFlicButton *_Nonnull)button didUpdateRSSI:(NSNumber *_Nonnull)RSSI error:(NSError *_Nullable)error
Parameters
button |
The SCLFlicButton object that the event came from. |
---|---|
RSSI |
The RSSI value represented in decibels. |
error |
In case there was a problem with updating the RSSI value then this parameter will describe the error. This will in all other cases be nil. |
Discussion
This callback verifies (unless an error occurred) that the RSSI value was updated.
Declared In
SCLFlicPoicButton.h