diff --git a/CHANGELOG.md b/CHANGELOG.md index 02f225a..7842b1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,18 @@ +#fliclib-ios 0.6.7 + +**Changes** + +* Added a flag for background execution in the manager initializing method. +* Swift compatibillity verified. +* Added Nullability Annotations. +* Updated documentation. + +**Issues fixed** + +* Fixed an issue that resulted in the flicButtonIsReady: not being sent on every connect. +* Fixed an issue with the outgoing packet signing that caused the Flic to drop indicateLED: calls. + +Please note that these fixes requires the firmware version R11 on the Flic to work properly. + # fliclib-ios 0.6.6 Initial commit diff --git a/fliclib.framework/Headers/SCLFlicButton.h b/fliclib.framework/Headers/SCLFlicButton.h index 4b5995c..ce1a4a0 100644 --- a/fliclib.framework/Headers/SCLFlicButton.h +++ b/fliclib.framework/Headers/SCLFlicButton.h @@ -8,7 +8,6 @@ #import #import -#import /*! * @enum SCLFlicButtonConnectionState @@ -75,8 +74,6 @@ typedef NS_ENUM(NSInteger, SCLFlicButtonMode) { * has been made. This is the most energy conservative mode, but may have a negative effect on response time. This is the recommended mode * for all applications where latency is not an issue. * - * While in this mode you will not get any button disconnect/connect events since all that will be handled internally. - * Update: You will now get these events! It might be removed at a later point, to be decided. */ SCLFlicButtonModePassive = 3, }; @@ -241,7 +238,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * @discussion The delegate object that will receive events related to this particular flic. * */ -@property(weak, nonatomic) id delegate; +@property(weak, nonatomic, nullable) id delegate; /*! * @property buttonIdentifier @@ -249,7 +246,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * @discussion The virtual ID of the flic. * */ -@property (readonly, nonatomic, strong) NSUUID *buttonIdentifier; +@property (readonly, nonatomic, strong, nonnull) NSUUID *buttonIdentifier; /*! * @property buttonPublicKey @@ -257,7 +254,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * @discussion The public key of the flic. This in the key that is used to identify the flic on our backend. * */ -@property (readonly, nonatomic, strong) NSString *buttonPublicKey; +@property (readonly, nonatomic, strong, nonnull) NSString *buttonPublicKey; /*! * @property name @@ -265,7 +262,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * @discussion The Bluetooth device name of the flic button. * */ -@property (atomic, readonly, strong) NSString *name; +@property (atomic, readonly, strong, nonnull) NSString *name; /*! @@ -329,6 +326,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * @method indicateLED: * * @discussion Use this method when you want to indicate something to the user by fading the LED. Be mindful with battery usage. + * This will only work if the Flic is connected. * * @param count Decides how many times the LED will indicate (fade) */ @@ -366,7 +364,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * @protocol SCLFlicButtonDelegate * * @discussion 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. + * any required delegate methods, but all are recommended for proper use of the Flic. * */ @protocol SCLFlicButtonDelegate @@ -388,7 +386,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * @discussion The flic registered a button down event. * */ -- (void) flicButton:(SCLFlicButton *) button didReceiveButtonDown:(BOOL) queued age: (NSInteger) age; +- (void) flicButton:(SCLFlicButton * _Nonnull) button didReceiveButtonDown:(BOOL) queued age: (NSInteger) age; /*! * @method flicButton:didReceiveButtonUp:age: @@ -403,7 +401,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * @discussion The flic registered a button up event. * */ -- (void) flicButton:(SCLFlicButton *) button didReceiveButtonUp:(BOOL) queued age: (NSInteger) age; +- (void) flicButton:(SCLFlicButton * _Nonnull) button didReceiveButtonUp:(BOOL) queued age: (NSInteger) age; /*! * @method flicButton:didReceiveButtonClick:age: @@ -419,7 +417,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to. * */ -- (void) flicButton:(SCLFlicButton *) button didReceiveButtonClick:(BOOL) queued age: (NSInteger) age; +- (void) flicButton:(SCLFlicButton * _Nonnull) button didReceiveButtonClick:(BOOL) queued age: (NSInteger) age; /*! * @method flicButton:didReceiveButtonDoubleClick:age: @@ -435,7 +433,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to. * */ -- (void) flicButton:(SCLFlicButton *) button didReceiveButtonDoubleClick:(BOOL) queued age: (NSInteger) age; +- (void) flicButton:(SCLFlicButton * _Nonnull) button didReceiveButtonDoubleClick:(BOOL) queued age: (NSInteger) age; /*! * @method flicButton:didReceiveButtonHold:age: @@ -451,7 +449,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * The behavior of this event depends on what SCLFlicButtonTriggerBehavior the triggerBehavior property is set to. * */ -- (void) flicButton:(SCLFlicButton *) button didReceiveButtonHold:(BOOL) queued age: (NSInteger) age; +- (void) flicButton:(SCLFlicButton * _Nonnull) button didReceiveButtonHold:(BOOL) queued age: (NSInteger) age; /*! * @method flicButtonDidConnect: @@ -464,7 +462,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * after the flicButtonIsReady: callback has arrived. * */ -- (void) flicButtonDidConnect:(SCLFlicButton *)button; +- (void) flicButtonDidConnect:(SCLFlicButton * _Nonnull) button; /*! * @method flicButtonIsReady: @@ -473,12 +471,10 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * * @discussion This delegate method is called every time the flic has sucessfully connected and the autheticity has been verified. * You will not receive any press events from the flic 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 flic 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 flic. + * immediately after the flicButtonDidConnect: event. * */ -- (void) flicButtonIsReady:(SCLFlicButton *)button; +- (void) flicButtonIsReady:(SCLFlicButton * _Nonnull) button; /*! * @method flicButton:didDisconnectWithError: @@ -490,7 +486,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * This can sometimes be called during a connection event that failed before the user was notified of the connection. * */ -- (void) flicButton:(SCLFlicButton *) button didDisconnectWithError:(NSError *)error; +- (void) flicButton:(SCLFlicButton * _Nonnull) button didDisconnectWithError:(NSError * _Nullable) error; /*! * @method flicButton:didFailToConnectWithError: @@ -505,7 +501,7 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * need to call the connect: yourself to activate the pending connection once again. * */ -- (void) flicButton:(SCLFlicButton *)button didFailToConnectWithError:(NSError *)error; +- (void) flicButton:(SCLFlicButton * _Nonnull) button didFailToConnectWithError:(NSError * _Nullable) error; /*! * @method flicButton:didUpdateRSSI:error: @@ -518,6 +514,6 @@ typedef NS_ENUM(NSInteger, SCLFlicError) { * @discussion This callback verifies (unless an error occurred) that the RSSI value was updated. * */ -- (void) flicButton:(SCLFlicButton *)button didUpdateRSSI:(NSNumber *) RSSI error:(NSError *)error; +- (void) flicButton:(SCLFlicButton * _Nonnull) button didUpdateRSSI:(NSNumber * _Nonnull) RSSI error:(NSError * _Nullable) error; @end diff --git a/fliclib.framework/Headers/SCLFlicManager.h b/fliclib.framework/Headers/SCLFlicManager.h index b13cb64..375afd7 100644 --- a/fliclib.framework/Headers/SCLFlicManager.h +++ b/fliclib.framework/Headers/SCLFlicManager.h @@ -9,7 +9,6 @@ #import #import #import "SCLFlicButton.h" -#import /*! * @enum SCLFlicManagerBluetoothState @@ -53,13 +52,12 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) { * @class SCLFlicManager * * @discussion An instance of this class is required in order to perform any bluetooth LE communication with - * the flic. You need to use this in order to scan for, and discover, new buttons. The object will - * keep track of all the flics that are associated to the specific iOS device. It is important to - * mention that the SCLFlicManager does not support the regular state preservation and restoration protocol - * for view controllers, meaning that it does not support NSCoding. Instead, all of the state preservation - * will be taken cared of for you by the manager. Simply reinstantiate it using the - * initWithDelegate:appID:appSecret:andRestoreState: method and collect the associated - * flic objects using the knownButtons: method. + * the flic. The object will keep track of all the flics that are associated to the specific iOS device. + * It is important to mention that the SCLFlicManager does not support the regular state preservation + * and restoration protocol for view controllers, meaning that it does not support NSCoding. + * Instead, all of the state preservation will be taken cared of for you by the manager. + * Simply reinstantiate it using the initWithDelegate:appID:appSecret:andRestoreState: method + * and collect the associated flic objects using the knownButtons: method. * */ @interface SCLFlicManager : NSObject { @@ -73,7 +71,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) { * SCLFlicManagerDelegate to see what callbacks are available. * */ -@property(weak, nonatomic) id delegate; +@property(weak, nonatomic, nullable) id delegate; /*! * @property bluetoothState @@ -96,7 +94,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) { @property (readonly, getter=isEnabled) BOOL enabled; /*! - * @method initWithDelegate:appID:appSecret:andRestoreState: + * @method initWithDelegate:appID:appSecret:backgroundExecution:andRestoreState: * * @discussion The initialization call to use when you want to create a manager. This will initiate a SCLFlicManager and do the proper * preparation needed in order to start the bluetooth communication with flic buttons. The BOOL restore included @@ -114,35 +112,36 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) { * @param delegate The delegate that all callbacks will be sent to. * @param appID This is the App-ID string that the developer is required to have in order to use the fliclib framework. * @param appSecret This is the App-Secret string that the developer is required to have in order to use the fliclib framework. + * @param bExecution Flag that specifies if want to configure the Flic manager to support background execution. If YES, then you also + * have to check the "Uses Bluetooth LE accessories" option under your projects Background Modes settings. * @param restore Whether you want to create a brand new manager (and thus clearing any old manager) or restore the manager to a * previous state. * */ -- (instancetype) initWithDelegate:(id) delegate appID: (NSString *) appID appSecret: (NSString *) appSecret andRestoreState:(BOOL) restore; +- (instancetype _Nullable) initWithDelegate:(id _Nonnull) delegate appID: (NSString * _Nonnull) appID appSecret: (NSString * _Nonnull) appSecret backgroundExecution: (BOOL) bExecution andRestoreState:(BOOL) restore; /*! * @method knownButtons: * - * @discussion All buttons that have ever been discovered by the manager and not manually been forgotten/removed. + * @discussion All buttons that have ever been added to the manager and not manually been forgotten/removed. * * @return Dictionary containing the SCLFlicButton objects. The keys are of NSUUID type that represent the buttonIdentifier * of the SCLFlicButton instance. * */ -- (NSDictionary*) knownButtons; +- (NSDictionary* _Nonnull) knownButtons; /*! * @method forgetButton: * * @discussion This will attempt to completely remove the flic button from the manager and clear the SCLFlicButton instance. If the flic * is connected when this method is called then it will also be disconnected first. Remember to clear all your references - * to this particular button instance so that it properly gets cleared from memory. Only after doing this will you be able - * to discover the flic again when doing a new scan. + * to this particular button instance so that it properly gets cleared from memory. * * @param button The button that you wish to destroy. * */ -- (void) forgetButton:(SCLFlicButton *) button; +- (void) forgetButton:(SCLFlicButton * _Nonnull) button; /*! * @method disable @@ -172,7 +171,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) { * @param callback This is the callback URL that you want the Flic app to return the data to. * */ -- (void) requestButtonFromFlicAppWithCallback: (NSString *) callback; +- (void) requestButtonFromFlicAppWithCallback: (NSString * _Nonnull) callback; /*! * @method generateButtonFromURL: @@ -182,7 +181,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) { * @param url This is the full url that was returned from the Flic app. * */ -- (SCLFlicButton *) generateButtonFromURL: (NSURL *) url; +- (SCLFlicButton * _Nullable) generateButtonFromURL: (NSURL * _Nonnull) url; @end @@ -215,7 +214,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) { * pending again. * */ -- (void) flicManager:(SCLFlicManager *)manager didChangeBluetoothState: (SCLFlicManagerBluetoothState) state; +- (void) flicManager:(SCLFlicManager * _Nonnull) manager didChangeBluetoothState: (SCLFlicManagerBluetoothState) state; /*! * @method flicManagerDidRestoreState: @@ -228,7 +227,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) { * order to properly restore the rest of your application. Do not forget to re-set the delegate on all buttons. * */ -- (void) flicManagerDidRestoreState:(SCLFlicManager *)manager; +- (void) flicManagerDidRestoreState:(SCLFlicManager * _Nonnull) manager; /*! * @method flicManager:didForgetButton:error: @@ -241,7 +240,7 @@ typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) { * to also remove your references in case you still have any. * */ -- (void) flicManager:(SCLFlicManager *)manager didForgetButton:(NSUUID *)buttonIdentifier error:(NSError *)error; +- (void) flicManager:(SCLFlicManager * _Nonnull) manager didForgetButton:(NSUUID * _Nonnull) buttonIdentifier error:(NSError * _Nullable)error; @end \ No newline at end of file diff --git a/fliclib.framework/_CodeSignature/CodeResources b/fliclib.framework/_CodeSignature/CodeResources index f2f9b23..c337880 100644 --- a/fliclib.framework/_CodeSignature/CodeResources +++ b/fliclib.framework/_CodeSignature/CodeResources @@ -6,11 +6,11 @@ Headers/SCLFlicButton.h - 1e6dR9YA1A0SgaFNdCm2YUGgnCE= + 27Oc/wutVc0JJ4XB9lttupVgjXM= Headers/SCLFlicManager.h - k7QBH2bCApDpb3Z2INTtcdMmIms= + QnS8dgMVi0vdWRi8E8LaWxpwWY0= Headers/fliclib.h @@ -29,11 +29,11 @@ Headers/SCLFlicButton.h - 1e6dR9YA1A0SgaFNdCm2YUGgnCE= + 27Oc/wutVc0JJ4XB9lttupVgjXM= Headers/SCLFlicManager.h - k7QBH2bCApDpb3Z2INTtcdMmIms= + QnS8dgMVi0vdWRi8E8LaWxpwWY0= Headers/fliclib.h diff --git a/fliclib.framework/fliclib b/fliclib.framework/fliclib index 5e548a9..eb0b6af 100755 Binary files a/fliclib.framework/fliclib and b/fliclib.framework/fliclib differ