├── .gitignore ├── flic2lib.xcframework ├── ios-arm64_x86_64-maccatalyst │ └── flic2lib.framework │ │ ├── Versions │ │ ├── Current │ │ └── A │ │ │ ├── Modules │ │ │ └── module.modulemap │ │ │ ├── flic2lib │ │ │ ├── Headers │ │ │ ├── flic2lib.h │ │ │ ├── FLICManager.h │ │ │ ├── FLICEnums.h │ │ │ └── FLICButton.h │ │ │ └── Resources │ │ │ └── Info.plist │ │ ├── Headers │ │ ├── Modules │ │ ├── flic2lib │ │ └── Resources ├── ios-arm64 │ └── flic2lib.framework │ │ ├── flic2lib │ │ ├── Info.plist │ │ ├── Modules │ │ └── module.modulemap │ │ └── Headers │ │ ├── flic2lib.h │ │ ├── FLICManager.h │ │ ├── FLICEnums.h │ │ └── FLICButton.h ├── ios-arm64_x86_64-simulator │ └── flic2lib.framework │ │ ├── Modules │ │ └── module.modulemap │ │ ├── flic2lib │ │ ├── Info.plist │ │ └── Headers │ │ ├── flic2lib.h │ │ ├── FLICManager.h │ │ ├── FLICEnums.h │ │ └── FLICButton.h └── Info.plist ├── Package.swift ├── LICENCE (for the flic2lib binary).txt ├── README.md ├── CHANGELOG.md └── LICENCE (for the documentation and source code).txt /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/flic2lib: -------------------------------------------------------------------------------- 1 | Versions/Current/flic2lib -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64/flic2lib.framework/flic2lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/50ButtonsEach/flic2lib-ios/HEAD/flic2lib.xcframework/ios-arm64/flic2lib.framework/flic2lib -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64/flic2lib.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/50ButtonsEach/flic2lib-ios/HEAD/flic2lib.xcframework/ios-arm64/flic2lib.framework/Info.plist -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64/flic2lib.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module flic2lib { 2 | umbrella header "flic2lib.h" 3 | export * 4 | 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-simulator/flic2lib.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module flic2lib { 2 | umbrella header "flic2lib.h" 3 | export * 4 | 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-simulator/flic2lib.framework/flic2lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/50ButtonsEach/flic2lib-ios/HEAD/flic2lib.xcframework/ios-arm64_x86_64-simulator/flic2lib.framework/flic2lib -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-simulator/flic2lib.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/50ButtonsEach/flic2lib-ios/HEAD/flic2lib.xcframework/ios-arm64_x86_64-simulator/flic2lib.framework/Info.plist -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module flic2lib { 2 | umbrella header "flic2lib.h" 3 | export * 4 | 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Versions/A/flic2lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/50ButtonsEach/flic2lib-ios/HEAD/flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Versions/A/flic2lib -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.3 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "flic2lib", 6 | platforms: [ 7 | .macOS(.v11), .iOS(.v12), .tvOS(.v14) 8 | ], 9 | products: [ 10 | .library( 11 | name: "flic2lib", 12 | targets: ["flic2lib"]) 13 | ], 14 | targets: [ 15 | .binaryTarget( 16 | name: "flic2lib", 17 | path: "flic2lib.xcframework" 18 | ) 19 | ] 20 | ) 21 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64/flic2lib.framework/Headers/flic2lib.h: -------------------------------------------------------------------------------- 1 | // 2 | // flic2lib.h 3 | // flic2lib 4 | // 5 | // Created by Anton Meier on 2019-04-10. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | #import 13 | #import 14 | 15 | //! Project version number for flic2lib. 16 | FOUNDATION_EXPORT double flic2libVersionNumber; 17 | 18 | //! Project version string for flic2lib. 19 | FOUNDATION_EXPORT const unsigned char flic2libVersionString[]; 20 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-simulator/flic2lib.framework/Headers/flic2lib.h: -------------------------------------------------------------------------------- 1 | // 2 | // flic2lib.h 3 | // flic2lib 4 | // 5 | // Created by Anton Meier on 2019-04-10. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | #import 13 | #import 14 | 15 | //! Project version number for flic2lib. 16 | FOUNDATION_EXPORT double flic2libVersionNumber; 17 | 18 | //! Project version string for flic2lib. 19 | FOUNDATION_EXPORT const unsigned char flic2libVersionString[]; 20 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Versions/A/Headers/flic2lib.h: -------------------------------------------------------------------------------- 1 | // 2 | // flic2lib.h 3 | // flic2lib 4 | // 5 | // Created by Anton Meier on 2019-04-10. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | #import 13 | #import 14 | 15 | //! Project version number for flic2lib. 16 | FOUNDATION_EXPORT double flic2libVersionNumber; 17 | 18 | //! Project version string for flic2lib. 19 | FOUNDATION_EXPORT const unsigned char flic2libVersionString[]; 20 | -------------------------------------------------------------------------------- /LICENCE (for the flic2lib binary).txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Shortcut Labs AB 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software, to deal in the software with the rights to use, copy, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the software is furnished to do so, subject to the following condition: 4 | 5 | Licensee shall not modify, reverse engineer, disassemble, decompile or otherwise attempt to discover the source code of the software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Flic Logo Black](https://user-images.githubusercontent.com/2717016/70526105-1bbaa200-1b49-11ea-9aa0-49e7959300c3.png) 2 | 3 | # flic2lib-ios 4 | 5 | The official framework for Flic 2 on iOS. 6 | 7 | This repository contains all the resources needed in order to implement Flic 2 support into your iOS app! 8 | 9 | Have a look at the repository Wiki for further information: 10 | 11 | * [Tutorial](https://github.com/50ButtonsEach/flic2lib-ios/wiki/Tutorial) 12 | 13 | Learn how to configure Xcode and implement the necessary code. 14 | 15 | * [Documentation](https://github.com/50ButtonsEach/flic2lib-ios/wiki/Documentation) 16 | 17 | The API documentation of the flic2lib.framework. 18 | 19 | * [OS Version Compatibility](https://github.com/50ButtonsEach/flic2lib-ios/wiki/OS-Compatibility) 20 | 21 | Deployment information. 22 | 23 | ## Licence 24 | 25 | Any documentation or source code contained in this repository is released under [CC0](LICENCE%20(for%20the%20documentation%20and%20source%20code).txt). The flic2lib binary is released under a [separate license](LICENCE%20(for%20the%20flic2lib%20binary).txt) which allows you to use it almost without restrictions. -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 23D60 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | flic2lib 11 | CFBundleIdentifier 12 | com.shortcutlabs.flic2lib 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flic2lib 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.4.0 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 31 | DTPlatformName 32 | macosx 33 | DTPlatformVersion 34 | 14.0 35 | DTSDKBuild 36 | 23A334 37 | DTSDKName 38 | macosx14.0 39 | DTXcode 40 | 1501 41 | DTXcodeBuild 42 | 15A507 43 | LSMinimumSystemVersion 44 | 10.15 45 | UIDeviceFamily 46 | 47 | 2 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /flic2lib.xcframework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AvailableLibraries 6 | 7 | 8 | BinaryPath 9 | flic2lib.framework/flic2lib 10 | LibraryIdentifier 11 | ios-arm64_x86_64-simulator 12 | LibraryPath 13 | flic2lib.framework 14 | SupportedArchitectures 15 | 16 | arm64 17 | x86_64 18 | 19 | SupportedPlatform 20 | ios 21 | SupportedPlatformVariant 22 | simulator 23 | 24 | 25 | BinaryPath 26 | flic2lib.framework/flic2lib 27 | LibraryIdentifier 28 | ios-arm64 29 | LibraryPath 30 | flic2lib.framework 31 | SupportedArchitectures 32 | 33 | arm64 34 | 35 | SupportedPlatform 36 | ios 37 | 38 | 39 | BinaryPath 40 | flic2lib.framework/Versions/A/flic2lib 41 | LibraryIdentifier 42 | ios-arm64_x86_64-maccatalyst 43 | LibraryPath 44 | flic2lib.framework 45 | SupportedArchitectures 46 | 47 | arm64 48 | x86_64 49 | 50 | SupportedPlatform 51 | ios 52 | SupportedPlatformVariant 53 | maccatalyst 54 | 55 | 56 | CFBundlePackageType 57 | XFWK 58 | XCFrameworkFormatVersion 59 | 1.0 60 | 61 | 62 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ![Flic Logo Black](https://user-images.githubusercontent.com/2717016/70526105-1bbaa200-1b49-11ea-9aa0-49e7959300c3.png) 2 | 3 | # Changelog 4 | 5 | This file documents the changes between different build versions of the `flic2lib.framework` 6 | 7 | ## flic2lib-ios 1.4.0 8 | 9 | * Removed dependency on NSFileModificationDate, NSFileSystemFreeSize, NSFileSystemSize to avoid requirement to declare API usage reason 10 | 11 | ## flic2lib-ios 1.3.0 12 | 13 | ### Changes 14 | 15 | * Removed Bitcode 16 | 17 | * Dropped support for armv7 18 | 19 | ## flic2lib-ios 1.2.0 20 | 21 | ### Changes 22 | 23 | * The XCFramework bundle now adds an empty Mac Catalyst implementation for both Intel and Apple Silicon. This means that while Flic 2 functionality is still not supported on Mac, you will now at least be able to compile and run your project with Mac Catalyst. 24 | 25 | * The build for iOS Simulator now includes slices for arm64 (Apple Silicon). Slices for i386 (32 bit simulator) have been removed. 26 | 27 | * Frameworks up to date with with iphoneos14.5 sdk. 28 | 29 | ## flic2lib-ios 1.1.0 30 | 31 | ### Significant Changes 32 | 33 | * The framework is now distributed using the new XCFramework packaging format. This means that instead of a single `flic2lib.framework` file, you will need to use a `flic2lib.xcframework` bundle. This bundle is essentially a folder containing framework builds for all supported architectures. The main benefit of this is that the framework will from now on run in the iOS Simulator, by default, with no configuration needed. 34 | 35 | This change switch was necessary due to the fact that Xcode 11.4 now throws a compiler error if any embedded framework is not build for Simulator. This would only generate a warning in previous versions. Thus the previously provided simulator files would no longer work without the use of cumbersome build scripts. 36 | 37 | Xcode 11 is required in order to use XCFramework bundles. 38 | 39 | ### Minor Changes 40 | 41 | * New property, `latencyMode`, added. This property can be set using the new `FLICLatencyMode` enums. The purpose of this is to allow you to reduce the click latency on events that occur while the Flic is connected. This may be useful if you are developing a foreground application, such as a game, where a lower latency is needed. However, keep in mind that this will affect expected battery life. 42 | 43 | ## flic2lib-ios 1.0.5 44 | 45 | ### Significant Changes 46 | 47 | * Adjustments made to the framework in order to support Core Bluetooth API changes indtroduced in iOS 13.4. Older versions of this framework will still work on iOS 13.4, but we do recommend updating. If you do not update the framework then there is a risk that the button connection will not be re-set properly if connection is lost during the Bluetooth LE encryption exchange/setup process. This is particularily important for applications that uses long-term execution in the background. 48 | 49 | ### Minor Changes 50 | 51 | * Added human readable descriptions to all flic2lib error codes of the `FLICErrorDomain` and `FLICButtonScannerErrorDomain` error domains. This would be the enums `FLICButtonScannerErrorCode` and `FLICError`. The description can be read using the `NSLocalizedDescriptionKey` key of the error’s userInfo dictionary, which may be helpful for troubleshooting. 52 | 53 | ## flic2lib-ios 1.0.4 54 | 55 | ### Minor Changes 56 | 57 | * Removed SSL pinning from the automatic firmware update feature. This is mainly to avoid any certificate issues in the future. All firmware images are signed by Shortcut Labs regardless, so SSL pinning is not necessary. 58 | 59 | ## flic2lib-ios 1.0.3 60 | 61 | ### Minor Changes 62 | 63 | * Changed the bluetooth connection parameters in order to achieve lower click latency on events that occur while the Flic is connected. This should not affect the Flic battery life. 64 | * Added a property `isScanning` to FLICManager. 65 | * Add callback `button:didUpdateNickname:` to FLICButton to let the app know when the nickname has been updated. 66 | * Add callback `button:didUpdateBatteryVoltage:` to FLICButton to let the app know when the battryVoltage has been updated. 67 | 68 | ### Bug Fixes 69 | 70 | * Fixed a bug that could cause the `scanForButtonsWithStateChangeHandler:completion:` to end up in an infinite loop if `stopScan` was called from within the completion handler. 71 | * Changed the way that the lib syncs the nickname between different applications. 72 | 73 | ## flic2lib-ios 1.0.2 74 | 75 | ### Major Changes 76 | 77 | * Framework build target changed to iOS 9.0 and slices for both arm64 and armv7 are now included. This makes easier to include the framework in applications that targets both armv7 and arm64 devices. 78 | 79 | The framework still only support iOS 12 and up. Any version below 12, meaning iOS 9, 10 and 11, will not be able to connect Flic buttons. When you initially configure the manager you will get the `manager:didUpdateBluetoothState:` as usual, but the state will be `StateUnsupported` instead of `StatePoweredOn`. If you try to use the `scanForButtonsWithStateChangeHandler:completion:` despite this, then you will immediately get a completion with an error `FLICErrorDomain` with a code `FLICErrorUnsupportedOSVersion`. 80 | 81 | * CBManagerState enum has been replaced with FLICManagerState enum. This means that the manager property `CBManagerState cbState` has now been replaced with `FLICManagerState state` and the manager callback `manager:didUpdateBluetoothState:` and changed name to `manager:didUpdateState:`. 82 | 83 | ### Minor Changes 84 | 85 | * Added a missing `_Nullable` type specifier on the button parameter in the completion handler of the `scanForButtonsWithStateChangeHandler:completion:` method. 86 | 87 | * The `uint32_t batteryLevel` property has been changed to `float batteryVoltage`, since it better represents the data. Keep in mind that you can not make a perfect conversion of battery voltage to a battery percentage, which is why we provide the voltage instead. 88 | 89 | * Removed the codesign from the framework all together. It is not necessary to include this since the developer will re-sign it on release anyways (Embed & Sign). 90 | 91 | * Added error codes `FLICErrorUnsupportedOSVersion` and `FLICErrorAlreadyForgotten`. 92 | 93 | ### Bug Fixes 94 | 95 | * When writing the nickname, the truncation to 23 bytes now properly handles all kinds of UTF8 characters, such as 2, 3 and 4 byte characters. 96 | 97 | * Fixed a bug that could cause the `isReady` property to not update properly on re-connection. 98 | 99 | 100 | ## flic2lib-ios 1.0.1 101 | 102 | Minor change 103 | 104 | ## flic2lib-ios 1.0.0 105 | 106 | Initial version 107 | -------------------------------------------------------------------------------- /LICENCE (for the documentation and source code).txt: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64/flic2lib.framework/Headers/FLICManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // FLICManager.h 3 | // flic2lib 4 | // 5 | // Created by Anton Meier on 2019-04-11. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @protocol FLICManagerDelegate; 16 | 17 | /*! 18 | * @class FLICManager 19 | * 20 | * @discussion This interface is intended to be used as a singleton. It keeps track of all the buttons that have been paired with this particular app and restores them on each 21 | * application launch. 22 | * 23 | */ 24 | @interface FLICManager : NSObject 25 | 26 | /*! 27 | * @property delegate 28 | * 29 | * @discussion The delegate that all the FLICManagerDelegate events will be sent to. Usually this is configured only once when the application is first launched, using the 30 | * configureWithDelegate:buttonDelegate:background: method. 31 | * 32 | */ 33 | @property(weak, nonatomic, nullable) id delegate; 34 | 35 | /*! 36 | * @property buttonDelegate 37 | * 38 | * @discussion Once set, this delegate will automatically be set to every button instance on each application launch. This will also be assigned to new buttons that are discovered 39 | * using the scanForButtonsWithStateChangeHandler:completionHandler method. Using this delegate also ensures that the click events are delivered as fast as possible 40 | * when an application is restored in the background. 41 | * 42 | */ 43 | @property(weak, nonatomic, nullable) id buttonDelegate; 44 | 45 | /*! 46 | * @property state 47 | * 48 | * @discussion This is the state of the Flic manager. This state closely resembles the CBManager state of Apple's CoreBluetooth framework. You will only be able to communicate with 49 | * Flic buttons while the manager is in the FlicManagerStatePoweredOn state. 50 | * 51 | */ 52 | @property(readonly) FLICManagerState state; 53 | 54 | /*! 55 | * @property scanning 56 | * 57 | * @discussion Let's you know if a scan is currently running or not. Reading this value will not affect a scan. 58 | * 59 | */ 60 | @property(nonatomic, readonly) BOOL isScanning; 61 | 62 | /*! 63 | * @method sharedManager 64 | * 65 | * @discussion This class method return the singleton manager, assuming that it has been configured first using the configureWithDelegate:buttonDelegate:background: method first, 66 | * otherwise nil is returned. 67 | * 68 | */ 69 | + (instancetype _Nullable)sharedManager; 70 | 71 | /*! 72 | * @method 73 | * 74 | * @param delegate The delegate to be used with the manager singleton. 75 | * @param buttonDelegate The delegate to be automatically assigned to each FLICButton instance. 76 | * @param background Whether or not you intend to use this application in the background. 77 | * 78 | * @discussion This configuration method must be called before the manager can be used. It is recommended that this is done as soon as possible after your application has launched 79 | * in order to minimize the delay of any pending click events. The flic2lib officially only support iOS 12 and up, however, to make it easier for the developer, the framework 80 | * is built with a target of iOS 9 and contains slices for both arm64 and armv7. This means that you will be able to include, and load, the framework in apps that support iOS 9. 81 | * However, if you try to configure the manager on a device running iOS 11, or below, then the manager state will switch to FLICManagerStateUnsupported. A good place 82 | * to handle this would be in the manager:didUpdateSate: method. 83 | * 84 | */ 85 | + (instancetype _Nullable)configureWithDelegate:(id _Nullable)delegate 86 | buttonDelegate:(id _Nullable)buttonDelegate 87 | background:(BOOL)background; 88 | 89 | /*! 90 | * @method buttons 91 | * 92 | * @discussion This array will contain every button that is currently paired with this application. Each button will be added to the list after a call to 93 | * scanForButtonsWithStateChangeHandler:completionHandler: has completed without error. It is important to know that you may not try to access this list until after the 94 | * managerDidRestoreState: method has been sent to the manager delegate. 95 | * 96 | */ 97 | - (NSArray *)buttons; 98 | 99 | /*! 100 | * @method forgetButton: 101 | * 102 | * @param button The button that you wish to delete from the manager. 103 | * @param completion This returns the identifier of the button instance that was just removed along with an error, if needed. 104 | * 105 | * @discussion This will delete this button from the manager. After a successful call to this method you will no longer be able to communicate with the associated Flic button unless you 106 | * pair it again using the scanForButtonsWithStateChangeHandler:completionHandler:. On completion, the button will no longer be included in the manager's buttons array. 107 | * After a successful call to this method, you should discard of any references to that particular Flic button object. If you try to forget a button that is already forgotten, then 108 | * you will get an error with the FLICErrorAlreadyForgotten code. 109 | * 110 | */ 111 | - (void)forgetButton:(FLICButton *)button completion:(void (^)(NSUUID *uuid, NSError * _Nullable error))completion; 112 | 113 | /*! 114 | * @method 115 | * 116 | * @param stateHandler This handler returns status events that lets you know what the scanner is currently doing. The purpose of this handler is to provide a predefined states where 117 | * you may update your application UI. 118 | * @param completion The completion handler will always run and if successful it will return a new FLICButton instance, otherwise it will provide you with an error. 119 | * 120 | * @discussion This method lets you add new Flic buttons to the manager. The scan flow is automated and the stateHandler will let you know what information you should provide to 121 | * your application end user. If you try to scan for buttons while running on an iOS version below the mimimun requirement, then you will get an error with the 122 | * FLICErrorUnsupportedOSVersion error code. 123 | * 124 | */ 125 | - (void)scanForButtonsWithStateChangeHandler:(void (^)(FLICButtonScannerStatusEvent event))stateHandler 126 | completion:(void (^)(FLICButton * _Nullable button, NSError * _Nullable error))completion; 127 | 128 | /*! 129 | * @method stopScan 130 | * 131 | * @discussion Cancel an ongoing button scan. This will result in a scan completion with an error. 132 | * 133 | */ 134 | - (void)stopScan; 135 | 136 | @end 137 | 138 | /*! 139 | * @protocol FLICManagerDelegate 140 | * 141 | * @discussion The delegate of a FLICManager instance must adopt the FLICManagerDelegate protocol. All calls to the delegate methods will be on the main dispatch queue. 142 | * 143 | */ 144 | @protocol FLICManagerDelegate 145 | 146 | /*! 147 | * @method managerDidRestoreState: 148 | * 149 | * @param manager The manager instance that the event originates from. Since this is intended to be used as a singleton, there should only ever be one manager instance. 150 | * 151 | * @discussion This is called once the manager has been restored. This means that all the FLICButton instances from your previous session are restored as well. After this method 152 | * has been called you may start using the manager and communicate with the Flic buttons. This method will only be called once on each application launch. 153 | * 154 | */ 155 | - (void)managerDidRestoreState:(FLICManager *)manager; 156 | 157 | /*! 158 | * @method manager:didUpdateState: 159 | * 160 | * @param manager The manager instance that the event originates from. Since this is intended to be used as a singleton, there should only ever be one manager instance. 161 | * @param state The state of the Flic manager singleton. 162 | * 163 | * @discussion Each time the state of the Flic manager changes, you will get this callback. Usually this is related to bluetooth state changes on the iOS device. It is also guaranteed to 164 | * be called at least once after the manager has been configured. 165 | * 166 | */ 167 | - (void)manager:(FLICManager *)manager didUpdateState:(FLICManagerState)state; 168 | 169 | @end 170 | 171 | NS_ASSUME_NONNULL_END 172 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-simulator/flic2lib.framework/Headers/FLICManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // FLICManager.h 3 | // flic2lib 4 | // 5 | // Created by Anton Meier on 2019-04-11. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @protocol FLICManagerDelegate; 16 | 17 | /*! 18 | * @class FLICManager 19 | * 20 | * @discussion This interface is intended to be used as a singleton. It keeps track of all the buttons that have been paired with this particular app and restores them on each 21 | * application launch. 22 | * 23 | */ 24 | @interface FLICManager : NSObject 25 | 26 | /*! 27 | * @property delegate 28 | * 29 | * @discussion The delegate that all the FLICManagerDelegate events will be sent to. Usually this is configured only once when the application is first launched, using the 30 | * configureWithDelegate:buttonDelegate:background: method. 31 | * 32 | */ 33 | @property(weak, nonatomic, nullable) id delegate; 34 | 35 | /*! 36 | * @property buttonDelegate 37 | * 38 | * @discussion Once set, this delegate will automatically be set to every button instance on each application launch. This will also be assigned to new buttons that are discovered 39 | * using the scanForButtonsWithStateChangeHandler:completionHandler method. Using this delegate also ensures that the click events are delivered as fast as possible 40 | * when an application is restored in the background. 41 | * 42 | */ 43 | @property(weak, nonatomic, nullable) id buttonDelegate; 44 | 45 | /*! 46 | * @property state 47 | * 48 | * @discussion This is the state of the Flic manager. This state closely resembles the CBManager state of Apple's CoreBluetooth framework. You will only be able to communicate with 49 | * Flic buttons while the manager is in the FlicManagerStatePoweredOn state. 50 | * 51 | */ 52 | @property(readonly) FLICManagerState state; 53 | 54 | /*! 55 | * @property scanning 56 | * 57 | * @discussion Let's you know if a scan is currently running or not. Reading this value will not affect a scan. 58 | * 59 | */ 60 | @property(nonatomic, readonly) BOOL isScanning; 61 | 62 | /*! 63 | * @method sharedManager 64 | * 65 | * @discussion This class method return the singleton manager, assuming that it has been configured first using the configureWithDelegate:buttonDelegate:background: method first, 66 | * otherwise nil is returned. 67 | * 68 | */ 69 | + (instancetype _Nullable)sharedManager; 70 | 71 | /*! 72 | * @method 73 | * 74 | * @param delegate The delegate to be used with the manager singleton. 75 | * @param buttonDelegate The delegate to be automatically assigned to each FLICButton instance. 76 | * @param background Whether or not you intend to use this application in the background. 77 | * 78 | * @discussion This configuration method must be called before the manager can be used. It is recommended that this is done as soon as possible after your application has launched 79 | * in order to minimize the delay of any pending click events. The flic2lib officially only support iOS 12 and up, however, to make it easier for the developer, the framework 80 | * is built with a target of iOS 9 and contains slices for both arm64 and armv7. This means that you will be able to include, and load, the framework in apps that support iOS 9. 81 | * However, if you try to configure the manager on a device running iOS 11, or below, then the manager state will switch to FLICManagerStateUnsupported. A good place 82 | * to handle this would be in the manager:didUpdateSate: method. 83 | * 84 | */ 85 | + (instancetype _Nullable)configureWithDelegate:(id _Nullable)delegate 86 | buttonDelegate:(id _Nullable)buttonDelegate 87 | background:(BOOL)background; 88 | 89 | /*! 90 | * @method buttons 91 | * 92 | * @discussion This array will contain every button that is currently paired with this application. Each button will be added to the list after a call to 93 | * scanForButtonsWithStateChangeHandler:completionHandler: has completed without error. It is important to know that you may not try to access this list until after the 94 | * managerDidRestoreState: method has been sent to the manager delegate. 95 | * 96 | */ 97 | - (NSArray *)buttons; 98 | 99 | /*! 100 | * @method forgetButton: 101 | * 102 | * @param button The button that you wish to delete from the manager. 103 | * @param completion This returns the identifier of the button instance that was just removed along with an error, if needed. 104 | * 105 | * @discussion This will delete this button from the manager. After a successful call to this method you will no longer be able to communicate with the associated Flic button unless you 106 | * pair it again using the scanForButtonsWithStateChangeHandler:completionHandler:. On completion, the button will no longer be included in the manager's buttons array. 107 | * After a successful call to this method, you should discard of any references to that particular Flic button object. If you try to forget a button that is already forgotten, then 108 | * you will get an error with the FLICErrorAlreadyForgotten code. 109 | * 110 | */ 111 | - (void)forgetButton:(FLICButton *)button completion:(void (^)(NSUUID *uuid, NSError * _Nullable error))completion; 112 | 113 | /*! 114 | * @method 115 | * 116 | * @param stateHandler This handler returns status events that lets you know what the scanner is currently doing. The purpose of this handler is to provide a predefined states where 117 | * you may update your application UI. 118 | * @param completion The completion handler will always run and if successful it will return a new FLICButton instance, otherwise it will provide you with an error. 119 | * 120 | * @discussion This method lets you add new Flic buttons to the manager. The scan flow is automated and the stateHandler will let you know what information you should provide to 121 | * your application end user. If you try to scan for buttons while running on an iOS version below the mimimun requirement, then you will get an error with the 122 | * FLICErrorUnsupportedOSVersion error code. 123 | * 124 | */ 125 | - (void)scanForButtonsWithStateChangeHandler:(void (^)(FLICButtonScannerStatusEvent event))stateHandler 126 | completion:(void (^)(FLICButton * _Nullable button, NSError * _Nullable error))completion; 127 | 128 | /*! 129 | * @method stopScan 130 | * 131 | * @discussion Cancel an ongoing button scan. This will result in a scan completion with an error. 132 | * 133 | */ 134 | - (void)stopScan; 135 | 136 | @end 137 | 138 | /*! 139 | * @protocol FLICManagerDelegate 140 | * 141 | * @discussion The delegate of a FLICManager instance must adopt the FLICManagerDelegate protocol. All calls to the delegate methods will be on the main dispatch queue. 142 | * 143 | */ 144 | @protocol FLICManagerDelegate 145 | 146 | /*! 147 | * @method managerDidRestoreState: 148 | * 149 | * @param manager The manager instance that the event originates from. Since this is intended to be used as a singleton, there should only ever be one manager instance. 150 | * 151 | * @discussion This is called once the manager has been restored. This means that all the FLICButton instances from your previous session are restored as well. After this method 152 | * has been called you may start using the manager and communicate with the Flic buttons. This method will only be called once on each application launch. 153 | * 154 | */ 155 | - (void)managerDidRestoreState:(FLICManager *)manager; 156 | 157 | /*! 158 | * @method manager:didUpdateState: 159 | * 160 | * @param manager The manager instance that the event originates from. Since this is intended to be used as a singleton, there should only ever be one manager instance. 161 | * @param state The state of the Flic manager singleton. 162 | * 163 | * @discussion Each time the state of the Flic manager changes, you will get this callback. Usually this is related to bluetooth state changes on the iOS device. It is also guaranteed to 164 | * be called at least once after the manager has been configured. 165 | * 166 | */ 167 | - (void)manager:(FLICManager *)manager didUpdateState:(FLICManagerState)state; 168 | 169 | @end 170 | 171 | NS_ASSUME_NONNULL_END 172 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Versions/A/Headers/FLICManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // FLICManager.h 3 | // flic2lib 4 | // 5 | // Created by Anton Meier on 2019-04-11. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @protocol FLICManagerDelegate; 16 | 17 | /*! 18 | * @class FLICManager 19 | * 20 | * @discussion This interface is intended to be used as a singleton. It keeps track of all the buttons that have been paired with this particular app and restores them on each 21 | * application launch. 22 | * 23 | */ 24 | @interface FLICManager : NSObject 25 | 26 | /*! 27 | * @property delegate 28 | * 29 | * @discussion The delegate that all the FLICManagerDelegate events will be sent to. Usually this is configured only once when the application is first launched, using the 30 | * configureWithDelegate:buttonDelegate:background: method. 31 | * 32 | */ 33 | @property(weak, nonatomic, nullable) id delegate; 34 | 35 | /*! 36 | * @property buttonDelegate 37 | * 38 | * @discussion Once set, this delegate will automatically be set to every button instance on each application launch. This will also be assigned to new buttons that are discovered 39 | * using the scanForButtonsWithStateChangeHandler:completionHandler method. Using this delegate also ensures that the click events are delivered as fast as possible 40 | * when an application is restored in the background. 41 | * 42 | */ 43 | @property(weak, nonatomic, nullable) id buttonDelegate; 44 | 45 | /*! 46 | * @property state 47 | * 48 | * @discussion This is the state of the Flic manager. This state closely resembles the CBManager state of Apple's CoreBluetooth framework. You will only be able to communicate with 49 | * Flic buttons while the manager is in the FlicManagerStatePoweredOn state. 50 | * 51 | */ 52 | @property(readonly) FLICManagerState state; 53 | 54 | /*! 55 | * @property scanning 56 | * 57 | * @discussion Let's you know if a scan is currently running or not. Reading this value will not affect a scan. 58 | * 59 | */ 60 | @property(nonatomic, readonly) BOOL isScanning; 61 | 62 | /*! 63 | * @method sharedManager 64 | * 65 | * @discussion This class method return the singleton manager, assuming that it has been configured first using the configureWithDelegate:buttonDelegate:background: method first, 66 | * otherwise nil is returned. 67 | * 68 | */ 69 | + (instancetype _Nullable)sharedManager; 70 | 71 | /*! 72 | * @method 73 | * 74 | * @param delegate The delegate to be used with the manager singleton. 75 | * @param buttonDelegate The delegate to be automatically assigned to each FLICButton instance. 76 | * @param background Whether or not you intend to use this application in the background. 77 | * 78 | * @discussion This configuration method must be called before the manager can be used. It is recommended that this is done as soon as possible after your application has launched 79 | * in order to minimize the delay of any pending click events. The flic2lib officially only support iOS 12 and up, however, to make it easier for the developer, the framework 80 | * is built with a target of iOS 9 and contains slices for both arm64 and armv7. This means that you will be able to include, and load, the framework in apps that support iOS 9. 81 | * However, if you try to configure the manager on a device running iOS 11, or below, then the manager state will switch to FLICManagerStateUnsupported. A good place 82 | * to handle this would be in the manager:didUpdateSate: method. 83 | * 84 | */ 85 | + (instancetype _Nullable)configureWithDelegate:(id _Nullable)delegate 86 | buttonDelegate:(id _Nullable)buttonDelegate 87 | background:(BOOL)background; 88 | 89 | /*! 90 | * @method buttons 91 | * 92 | * @discussion This array will contain every button that is currently paired with this application. Each button will be added to the list after a call to 93 | * scanForButtonsWithStateChangeHandler:completionHandler: has completed without error. It is important to know that you may not try to access this list until after the 94 | * managerDidRestoreState: method has been sent to the manager delegate. 95 | * 96 | */ 97 | - (NSArray *)buttons; 98 | 99 | /*! 100 | * @method forgetButton: 101 | * 102 | * @param button The button that you wish to delete from the manager. 103 | * @param completion This returns the identifier of the button instance that was just removed along with an error, if needed. 104 | * 105 | * @discussion This will delete this button from the manager. After a successful call to this method you will no longer be able to communicate with the associated Flic button unless you 106 | * pair it again using the scanForButtonsWithStateChangeHandler:completionHandler:. On completion, the button will no longer be included in the manager's buttons array. 107 | * After a successful call to this method, you should discard of any references to that particular Flic button object. If you try to forget a button that is already forgotten, then 108 | * you will get an error with the FLICErrorAlreadyForgotten code. 109 | * 110 | */ 111 | - (void)forgetButton:(FLICButton *)button completion:(void (^)(NSUUID *uuid, NSError * _Nullable error))completion; 112 | 113 | /*! 114 | * @method 115 | * 116 | * @param stateHandler This handler returns status events that lets you know what the scanner is currently doing. The purpose of this handler is to provide a predefined states where 117 | * you may update your application UI. 118 | * @param completion The completion handler will always run and if successful it will return a new FLICButton instance, otherwise it will provide you with an error. 119 | * 120 | * @discussion This method lets you add new Flic buttons to the manager. The scan flow is automated and the stateHandler will let you know what information you should provide to 121 | * your application end user. If you try to scan for buttons while running on an iOS version below the mimimun requirement, then you will get an error with the 122 | * FLICErrorUnsupportedOSVersion error code. 123 | * 124 | */ 125 | - (void)scanForButtonsWithStateChangeHandler:(void (^)(FLICButtonScannerStatusEvent event))stateHandler 126 | completion:(void (^)(FLICButton * _Nullable button, NSError * _Nullable error))completion; 127 | 128 | /*! 129 | * @method stopScan 130 | * 131 | * @discussion Cancel an ongoing button scan. This will result in a scan completion with an error. 132 | * 133 | */ 134 | - (void)stopScan; 135 | 136 | @end 137 | 138 | /*! 139 | * @protocol FLICManagerDelegate 140 | * 141 | * @discussion The delegate of a FLICManager instance must adopt the FLICManagerDelegate protocol. All calls to the delegate methods will be on the main dispatch queue. 142 | * 143 | */ 144 | @protocol FLICManagerDelegate 145 | 146 | /*! 147 | * @method managerDidRestoreState: 148 | * 149 | * @param manager The manager instance that the event originates from. Since this is intended to be used as a singleton, there should only ever be one manager instance. 150 | * 151 | * @discussion This is called once the manager has been restored. This means that all the FLICButton instances from your previous session are restored as well. After this method 152 | * has been called you may start using the manager and communicate with the Flic buttons. This method will only be called once on each application launch. 153 | * 154 | */ 155 | - (void)managerDidRestoreState:(FLICManager *)manager; 156 | 157 | /*! 158 | * @method manager:didUpdateState: 159 | * 160 | * @param manager The manager instance that the event originates from. Since this is intended to be used as a singleton, there should only ever be one manager instance. 161 | * @param state The state of the Flic manager singleton. 162 | * 163 | * @discussion Each time the state of the Flic manager changes, you will get this callback. Usually this is related to bluetooth state changes on the iOS device. It is also guaranteed to 164 | * be called at least once after the manager has been configured. 165 | * 166 | */ 167 | - (void)manager:(FLICManager *)manager didUpdateState:(FLICManagerState)state; 168 | 169 | @end 170 | 171 | NS_ASSUME_NONNULL_END 172 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64/flic2lib.framework/Headers/FLICEnums.h: -------------------------------------------------------------------------------- 1 | // 2 | // FLICEnums.h 3 | // fliclib 4 | // 5 | // Created by Anton Meier on 2019-04-18. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #ifndef FLICEnums_h 10 | #define FLICEnums_h 11 | 12 | extern NSString * const FLICErrorDomain; 13 | extern NSString * const FLICButtonScannerErrorDomain; 14 | 15 | /*! 16 | * @enum FLICManagerState 17 | * 18 | * @discussion Represents the the different states that a Flic manager can be in at any given time. These states are mostly translated values of Apple's CoreBluetooth CBManagerState enums. 19 | * 20 | */ 21 | typedef NS_ENUM(NSInteger, FLICManagerState) 22 | { 23 | /** 24 | * State is unknown, update imminent. 25 | */ 26 | FLICManagerStateUnknown = 0, 27 | /** 28 | * The bluetooth connection with the system service was momentarily lost, update imminent. 29 | */ 30 | FLICManagerStateResetting, 31 | /** 32 | * The Flic manager can not be used on this platform. 33 | */ 34 | FLICManagerStateUnsupported, 35 | /** 36 | * The application is not authorized to use Bluetooth Low Energy. 37 | */ 38 | FLICManagerStateUnauthorized, 39 | /** 40 | * Bluetooth is currently powered off. 41 | */ 42 | FLICManagerStatePoweredOff, 43 | /** 44 | * Bluetooth is currently powered on and available to use. 45 | */ 46 | FLICManagerStatePoweredOn 47 | }; 48 | 49 | /*! 50 | * @enum FLICButtonScannerErrorCode 51 | * 52 | * @discussion Represents the different error codes that can be generated while scanning and pairing new Flics. 53 | * 54 | */ 55 | typedef NS_ENUM(NSInteger, FLICButtonScannerErrorCode) 56 | { 57 | /** 58 | * The scan was unsuccessful due to an unknown reason. 59 | */ 60 | FLICButtonScannerErrorCodeUnknown = 0, 61 | /** 62 | * The scan could not be started since bluetooth was not in the powered on state. 63 | */ 64 | FLICButtonScannerErrorCodeBluetoothNotActivated, 65 | /** 66 | * No button was advertising in public mode within proximity. 67 | */ 68 | FLICButtonScannerErrorCodeNoPublicButtonDiscovered, 69 | /** 70 | * The bluetooth pairing failed since the user already has paired this button before with this device. 71 | * This is solved by removing the pairing from the iOS bluetooth pairing settings screen. 72 | */ 73 | FLICButtonScannerErrorCodeBLEPairingFailedPreviousPairingAlreadyExisting, 74 | /** 75 | * The bluetooth pairing failed since the user pressed cancel on the pairing dialog. 76 | */ 77 | FLICButtonScannerErrorCodeBLEPairingFailedUserCanceled, 78 | /** 79 | * The bluetooth pairing failed since iOS decided to decline the request. It is unknown why or if this can happen. 80 | */ 81 | FLICButtonScannerErrorCodeBLEPairingFailedUnknownReason, 82 | /** 83 | * Indicates that the button cannot be unlocked since it belongs to a different brand. 84 | */ 85 | FLICButtonScannerErrorCodeAppCredentialsDontMatch, 86 | /** 87 | * The scan was manually canceled using the stopScan method. 88 | */ 89 | FLICButtonScannerErrorCodeUserCanceled, 90 | /** 91 | * The Flic's certificate belongs to a different bluetooth address. 92 | */ 93 | FLICButtonScannerErrorCodeInvalidBluetoothAddress, 94 | /** 95 | * The framework was unable to pair with the Flic since it did not pass the authenticity check. 96 | */ 97 | FLICButtonScannerErrorCodeGenuineCheckFailed, 98 | /** 99 | * The discovered Flic cannot be connected since it is currently connected to a different device. 100 | */ 101 | FLICButtonScannerErrorCodeAlreadyConnectedToAnotherDevice, 102 | /** 103 | * The discovered Flic cannot be connected since the maximum number of simultaneous app connections has been reached. 104 | */ 105 | FLICButtonScannerErrorCodeTooManyApps, 106 | /** 107 | * A bluetooth specific error. The framework was unable to establish a connection to the Flic peripheral. 108 | */ 109 | FLICButtonScannerErrorCodeCouldNotSetBluetoothNotify, 110 | /** 111 | * A bluetooth specific error. The framework was unable to establish a connection to the Flic peripheral. 112 | */ 113 | FLICButtonScannerErrorCodeCouldNotDiscoverBluetoothServices, 114 | /** 115 | * The bluetooth connection was dropped during the verification process. 116 | */ 117 | FLICButtonScannerErrorCodeButtonDisconnectedDuringVerification, 118 | /** 119 | * The Flic peripheral connection was unexpectedly lost. 120 | */ 121 | FLICButtonScannerErrorCodeConnectionTimeout, 122 | /** 123 | * The bluetooth connection failed. 124 | */ 125 | FLICButtonScannerErrorCodeFailedToEstablish, 126 | /** 127 | * The iOS device reached the maximum number of allowed bluetooth peripherals. 128 | */ 129 | FLICButtonScannerErrorCodeConnectionLimitReached, 130 | /** 131 | * The signature generated by the Flic button could not be verified. 132 | */ 133 | FLICButtonScannerErrorCodeInvalidVerifier, 134 | /** 135 | * The Flic button was no longer in public mode when the verification process ran. 136 | */ 137 | FLICButtonScannerErrorCodeNotInPublicMode, 138 | }; 139 | 140 | /*! 141 | * @enum FLICButtonScannerStatusEvent 142 | * 143 | * @discussion While the scanner is running, it will send a status events to let you know what it is doing. These enums represents those events. 144 | * 145 | */ 146 | typedef NS_ENUM(NSInteger, FLICButtonScannerStatusEvent) 147 | { 148 | /** 149 | * A public Flic has been discovered and a connection attempt will now be made. 150 | */ 151 | FLICButtonScannerStatusEventDiscovered = 0, 152 | /** 153 | * The Flic was successfully bluetooth connected. 154 | */ 155 | FLICButtonScannerStatusEventConnected, 156 | /** 157 | * The Flic has been verified and unlocked for this app. The Flic will soon be delivered in the assigned completion handler. 158 | */ 159 | FLICButtonScannerStatusEventVerified, 160 | /** 161 | * The Flic could not be verified. The completion handler will soon run to let you know what the error was. 162 | */ 163 | FLICButtonScannerStatusEventVerificationFailed, 164 | }; 165 | 166 | /*! 167 | * @enum FLICError 168 | * 169 | * @discussion These enums represents the different error codes that can be sent from flic2lib, excluding the button scanner which has its own set of error codes. 170 | * 171 | */ 172 | typedef NS_ENUM(NSInteger, FLICError) 173 | { 174 | /** 175 | * An unknown error has occurred. 176 | */ 177 | FLICErrorUnknown = 0, 178 | /** 179 | * You are trying to use the manager while it has not been configured yet. 180 | */ 181 | FLICErrorNotConfigured, 182 | /** 183 | * A bluetooth specific error code. This means that something went wrong while the phone tried to establish a connection with the Flic peripheral. 184 | */ 185 | FLICErrorCouldNotDiscoverBluetoothServices, 186 | /** 187 | * The framework was unable to verify the cryptographic signature from the Flic while setting up a session. 188 | */ 189 | FLICErrorVerificationSignatureMismatch, 190 | /** 191 | * The UUID of a button is not correct. 192 | */ 193 | FLICErrorInvalidUuid, 194 | /** 195 | * While establishing a connection with the Flic the framework was unable to verify the authenticity of the button. 196 | */ 197 | FLICErrorGenuineCheckFailed, 198 | /** 199 | * The app was unable to establish a connection with the Flic button because it already had a connection with too many apps on this particular phone. 200 | */ 201 | FLICErrorTooManyApps, 202 | /** 203 | * The pairing on the Flic button has been lost so the app's pairing data is no longer valid. This typically happens if the Flic is factory reset. 204 | */ 205 | FLICErrorUnpaired, 206 | /** 207 | * The manager was unable to complete the task since the device is not running on a supported iOS version. 208 | */ 209 | FLICErrorUnsupportedOSVersion, 210 | /** 211 | * You are trying to use a FLICButton object that has already been forgotten by the manager. Please discard of your references to this object. 212 | */ 213 | FLICErrorAlreadyForgotten, 214 | }; 215 | 216 | /*! 217 | * @enum FLICButtonState 218 | * 219 | * @discussion The different states that a Flic can be in at any given time. 220 | * 221 | */ 222 | typedef NS_ENUM(NSInteger, FLICButtonState) 223 | { 224 | /** 225 | * The Flic is currently disconnected and a pending connection is not set. The Flic will not connect again unless you manually call the connect method. 226 | */ 227 | FLICButtonStateDisconnected = 0, 228 | /** 229 | * The Flic is currently disconnected, but a pending connection is set. The Flic will automatically connect again as soon as it becomes available. 230 | */ 231 | FLICButtonStateConnecting, 232 | /** 233 | * The Flic currently has a bluetooth connection with the phone. This does not necessarily mean that it has been verified. 234 | * Please listen for the isReady event, or read the isReady property, for that information 235 | */ 236 | FLICButtonStateConnected, 237 | /** 238 | * The Flic is currently connected, but is attempting to disconnect. Typically this state will only occur for very short periods of time before either switching to 239 | * the connecting or disconnected state again. 240 | */ 241 | FLICButtonStateDisconnecting, 242 | }; 243 | 244 | /*! 245 | * @enum FLICButtonTriggerMode 246 | * 247 | * @discussion The different trigger modes that you can configure the Flic button to use. Please make sure that you understand how these work. 248 | * The choosen trigger mode will affect the latency on the press events coming from the Flic button. 249 | * 250 | */ 251 | typedef NS_ENUM(NSInteger, FLICButtonTriggerMode) 252 | { 253 | /** 254 | * Used to distinguish between only click and hold. 255 | * 256 | * Click will be fired when the button is released if it was pressed for maximum 1 second. 257 | * Otherwise, hold will be fired 1 second after the button was pressed. Click will then not be fired upon release. 258 | * Since this option will only distinguish between click and hold it does not have to take double click into consideration. 259 | * This means that the click event can be sent immediately on button release rather than to wait for a possible double click. 260 | * 261 | * Note: this will be the default behavior. 262 | */ 263 | FLICButtonTriggerModeClickAndHold = 0, 264 | /** 265 | * Used to distinguish between only single click and double click. 266 | * 267 | * Double click will be registered if the time between two button down events was at most 0.5 seconds. 268 | * The double click event will then be fired upon button release. 269 | * 270 | * If the time was more than 0.5 seconds, a single click event will be fired; either directly upon button release if the button was down 271 | * for more than 0.5 seconds, or after 0.5 seconds if the button was down for less than 0.5 seconds. 272 | */ 273 | FLICButtonTriggerModeClickAndDoubleClick, 274 | /** 275 | * Used to distinguish between single click, double click and hold. 276 | * 277 | * If the time between the first button down and button up event was more than 1 second, a hold event will be fired. 278 | * Else, double click will be fired if the time between two button down events was at most 0.5 seconds. 279 | * The double click event will then be fired upon button release. 280 | * 281 | * If the time was more than 0.5 seconds, a single click event will be fired; either directly upon button release if the button was down 282 | * for more than 0.5 seconds, or after 0.5 seconds if the button was down for less than 0.5 seconds. 283 | * 284 | * Note: Three fast consecutive clicks means one double click and then one single click. Four fast consecutive clicks means two double clicks. 285 | */ 286 | FLICButtonTriggerModeClickAndDoubleClickAndHold, 287 | /** 288 | * This mode will only send click and the event will be sent directly on buttonDown. 289 | * This will be the same as listening for buttonDown. 290 | * 291 | * Note: This is optimal if your application requires the lowest latency possible. 292 | */ 293 | FLICButtonTriggerModeClick, 294 | }; 295 | 296 | /*! 297 | * @enum FLICButtonTriggerMode 298 | * 299 | * @discussion The different latency modes that you can configure the Flic button to use. 300 | * 301 | */ 302 | typedef NS_ENUM(NSInteger, FLICLatencyMode) 303 | { 304 | /** 305 | * This is the default mode of the button. It will give you a good compromise between click latency (less than 105 ms while connected) and current consumption. 306 | */ 307 | FLICLatencyModeNormal = 0, 308 | /** 309 | * Using this mode will give your button the lowest possible click latency (typicaly less than 30 ms while connected). 310 | * This mode will significantly increase the current consumption. 311 | */ 312 | FLICLatencyModeLow, 313 | }; 314 | 315 | #endif /* FLICEnums_h */ 316 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-simulator/flic2lib.framework/Headers/FLICEnums.h: -------------------------------------------------------------------------------- 1 | // 2 | // FLICEnums.h 3 | // fliclib 4 | // 5 | // Created by Anton Meier on 2019-04-18. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #ifndef FLICEnums_h 10 | #define FLICEnums_h 11 | 12 | extern NSString * const FLICErrorDomain; 13 | extern NSString * const FLICButtonScannerErrorDomain; 14 | 15 | /*! 16 | * @enum FLICManagerState 17 | * 18 | * @discussion Represents the the different states that a Flic manager can be in at any given time. These states are mostly translated values of Apple's CoreBluetooth CBManagerState enums. 19 | * 20 | */ 21 | typedef NS_ENUM(NSInteger, FLICManagerState) 22 | { 23 | /** 24 | * State is unknown, update imminent. 25 | */ 26 | FLICManagerStateUnknown = 0, 27 | /** 28 | * The bluetooth connection with the system service was momentarily lost, update imminent. 29 | */ 30 | FLICManagerStateResetting, 31 | /** 32 | * The Flic manager can not be used on this platform. 33 | */ 34 | FLICManagerStateUnsupported, 35 | /** 36 | * The application is not authorized to use Bluetooth Low Energy. 37 | */ 38 | FLICManagerStateUnauthorized, 39 | /** 40 | * Bluetooth is currently powered off. 41 | */ 42 | FLICManagerStatePoweredOff, 43 | /** 44 | * Bluetooth is currently powered on and available to use. 45 | */ 46 | FLICManagerStatePoweredOn 47 | }; 48 | 49 | /*! 50 | * @enum FLICButtonScannerErrorCode 51 | * 52 | * @discussion Represents the different error codes that can be generated while scanning and pairing new Flics. 53 | * 54 | */ 55 | typedef NS_ENUM(NSInteger, FLICButtonScannerErrorCode) 56 | { 57 | /** 58 | * The scan was unsuccessful due to an unknown reason. 59 | */ 60 | FLICButtonScannerErrorCodeUnknown = 0, 61 | /** 62 | * The scan could not be started since bluetooth was not in the powered on state. 63 | */ 64 | FLICButtonScannerErrorCodeBluetoothNotActivated, 65 | /** 66 | * No button was advertising in public mode within proximity. 67 | */ 68 | FLICButtonScannerErrorCodeNoPublicButtonDiscovered, 69 | /** 70 | * The bluetooth pairing failed since the user already has paired this button before with this device. 71 | * This is solved by removing the pairing from the iOS bluetooth pairing settings screen. 72 | */ 73 | FLICButtonScannerErrorCodeBLEPairingFailedPreviousPairingAlreadyExisting, 74 | /** 75 | * The bluetooth pairing failed since the user pressed cancel on the pairing dialog. 76 | */ 77 | FLICButtonScannerErrorCodeBLEPairingFailedUserCanceled, 78 | /** 79 | * The bluetooth pairing failed since iOS decided to decline the request. It is unknown why or if this can happen. 80 | */ 81 | FLICButtonScannerErrorCodeBLEPairingFailedUnknownReason, 82 | /** 83 | * Indicates that the button cannot be unlocked since it belongs to a different brand. 84 | */ 85 | FLICButtonScannerErrorCodeAppCredentialsDontMatch, 86 | /** 87 | * The scan was manually canceled using the stopScan method. 88 | */ 89 | FLICButtonScannerErrorCodeUserCanceled, 90 | /** 91 | * The Flic's certificate belongs to a different bluetooth address. 92 | */ 93 | FLICButtonScannerErrorCodeInvalidBluetoothAddress, 94 | /** 95 | * The framework was unable to pair with the Flic since it did not pass the authenticity check. 96 | */ 97 | FLICButtonScannerErrorCodeGenuineCheckFailed, 98 | /** 99 | * The discovered Flic cannot be connected since it is currently connected to a different device. 100 | */ 101 | FLICButtonScannerErrorCodeAlreadyConnectedToAnotherDevice, 102 | /** 103 | * The discovered Flic cannot be connected since the maximum number of simultaneous app connections has been reached. 104 | */ 105 | FLICButtonScannerErrorCodeTooManyApps, 106 | /** 107 | * A bluetooth specific error. The framework was unable to establish a connection to the Flic peripheral. 108 | */ 109 | FLICButtonScannerErrorCodeCouldNotSetBluetoothNotify, 110 | /** 111 | * A bluetooth specific error. The framework was unable to establish a connection to the Flic peripheral. 112 | */ 113 | FLICButtonScannerErrorCodeCouldNotDiscoverBluetoothServices, 114 | /** 115 | * The bluetooth connection was dropped during the verification process. 116 | */ 117 | FLICButtonScannerErrorCodeButtonDisconnectedDuringVerification, 118 | /** 119 | * The Flic peripheral connection was unexpectedly lost. 120 | */ 121 | FLICButtonScannerErrorCodeConnectionTimeout, 122 | /** 123 | * The bluetooth connection failed. 124 | */ 125 | FLICButtonScannerErrorCodeFailedToEstablish, 126 | /** 127 | * The iOS device reached the maximum number of allowed bluetooth peripherals. 128 | */ 129 | FLICButtonScannerErrorCodeConnectionLimitReached, 130 | /** 131 | * The signature generated by the Flic button could not be verified. 132 | */ 133 | FLICButtonScannerErrorCodeInvalidVerifier, 134 | /** 135 | * The Flic button was no longer in public mode when the verification process ran. 136 | */ 137 | FLICButtonScannerErrorCodeNotInPublicMode, 138 | }; 139 | 140 | /*! 141 | * @enum FLICButtonScannerStatusEvent 142 | * 143 | * @discussion While the scanner is running, it will send a status events to let you know what it is doing. These enums represents those events. 144 | * 145 | */ 146 | typedef NS_ENUM(NSInteger, FLICButtonScannerStatusEvent) 147 | { 148 | /** 149 | * A public Flic has been discovered and a connection attempt will now be made. 150 | */ 151 | FLICButtonScannerStatusEventDiscovered = 0, 152 | /** 153 | * The Flic was successfully bluetooth connected. 154 | */ 155 | FLICButtonScannerStatusEventConnected, 156 | /** 157 | * The Flic has been verified and unlocked for this app. The Flic will soon be delivered in the assigned completion handler. 158 | */ 159 | FLICButtonScannerStatusEventVerified, 160 | /** 161 | * The Flic could not be verified. The completion handler will soon run to let you know what the error was. 162 | */ 163 | FLICButtonScannerStatusEventVerificationFailed, 164 | }; 165 | 166 | /*! 167 | * @enum FLICError 168 | * 169 | * @discussion These enums represents the different error codes that can be sent from flic2lib, excluding the button scanner which has its own set of error codes. 170 | * 171 | */ 172 | typedef NS_ENUM(NSInteger, FLICError) 173 | { 174 | /** 175 | * An unknown error has occurred. 176 | */ 177 | FLICErrorUnknown = 0, 178 | /** 179 | * You are trying to use the manager while it has not been configured yet. 180 | */ 181 | FLICErrorNotConfigured, 182 | /** 183 | * A bluetooth specific error code. This means that something went wrong while the phone tried to establish a connection with the Flic peripheral. 184 | */ 185 | FLICErrorCouldNotDiscoverBluetoothServices, 186 | /** 187 | * The framework was unable to verify the cryptographic signature from the Flic while setting up a session. 188 | */ 189 | FLICErrorVerificationSignatureMismatch, 190 | /** 191 | * The UUID of a button is not correct. 192 | */ 193 | FLICErrorInvalidUuid, 194 | /** 195 | * While establishing a connection with the Flic the framework was unable to verify the authenticity of the button. 196 | */ 197 | FLICErrorGenuineCheckFailed, 198 | /** 199 | * The app was unable to establish a connection with the Flic button because it already had a connection with too many apps on this particular phone. 200 | */ 201 | FLICErrorTooManyApps, 202 | /** 203 | * The pairing on the Flic button has been lost so the app's pairing data is no longer valid. This typically happens if the Flic is factory reset. 204 | */ 205 | FLICErrorUnpaired, 206 | /** 207 | * The manager was unable to complete the task since the device is not running on a supported iOS version. 208 | */ 209 | FLICErrorUnsupportedOSVersion, 210 | /** 211 | * You are trying to use a FLICButton object that has already been forgotten by the manager. Please discard of your references to this object. 212 | */ 213 | FLICErrorAlreadyForgotten, 214 | }; 215 | 216 | /*! 217 | * @enum FLICButtonState 218 | * 219 | * @discussion The different states that a Flic can be in at any given time. 220 | * 221 | */ 222 | typedef NS_ENUM(NSInteger, FLICButtonState) 223 | { 224 | /** 225 | * The Flic is currently disconnected and a pending connection is not set. The Flic will not connect again unless you manually call the connect method. 226 | */ 227 | FLICButtonStateDisconnected = 0, 228 | /** 229 | * The Flic is currently disconnected, but a pending connection is set. The Flic will automatically connect again as soon as it becomes available. 230 | */ 231 | FLICButtonStateConnecting, 232 | /** 233 | * The Flic currently has a bluetooth connection with the phone. This does not necessarily mean that it has been verified. 234 | * Please listen for the isReady event, or read the isReady property, for that information 235 | */ 236 | FLICButtonStateConnected, 237 | /** 238 | * The Flic is currently connected, but is attempting to disconnect. Typically this state will only occur for very short periods of time before either switching to 239 | * the connecting or disconnected state again. 240 | */ 241 | FLICButtonStateDisconnecting, 242 | }; 243 | 244 | /*! 245 | * @enum FLICButtonTriggerMode 246 | * 247 | * @discussion The different trigger modes that you can configure the Flic button to use. Please make sure that you understand how these work. 248 | * The choosen trigger mode will affect the latency on the press events coming from the Flic button. 249 | * 250 | */ 251 | typedef NS_ENUM(NSInteger, FLICButtonTriggerMode) 252 | { 253 | /** 254 | * Used to distinguish between only click and hold. 255 | * 256 | * Click will be fired when the button is released if it was pressed for maximum 1 second. 257 | * Otherwise, hold will be fired 1 second after the button was pressed. Click will then not be fired upon release. 258 | * Since this option will only distinguish between click and hold it does not have to take double click into consideration. 259 | * This means that the click event can be sent immediately on button release rather than to wait for a possible double click. 260 | * 261 | * Note: this will be the default behavior. 262 | */ 263 | FLICButtonTriggerModeClickAndHold = 0, 264 | /** 265 | * Used to distinguish between only single click and double click. 266 | * 267 | * Double click will be registered if the time between two button down events was at most 0.5 seconds. 268 | * The double click event will then be fired upon button release. 269 | * 270 | * If the time was more than 0.5 seconds, a single click event will be fired; either directly upon button release if the button was down 271 | * for more than 0.5 seconds, or after 0.5 seconds if the button was down for less than 0.5 seconds. 272 | */ 273 | FLICButtonTriggerModeClickAndDoubleClick, 274 | /** 275 | * Used to distinguish between single click, double click and hold. 276 | * 277 | * If the time between the first button down and button up event was more than 1 second, a hold event will be fired. 278 | * Else, double click will be fired if the time between two button down events was at most 0.5 seconds. 279 | * The double click event will then be fired upon button release. 280 | * 281 | * If the time was more than 0.5 seconds, a single click event will be fired; either directly upon button release if the button was down 282 | * for more than 0.5 seconds, or after 0.5 seconds if the button was down for less than 0.5 seconds. 283 | * 284 | * Note: Three fast consecutive clicks means one double click and then one single click. Four fast consecutive clicks means two double clicks. 285 | */ 286 | FLICButtonTriggerModeClickAndDoubleClickAndHold, 287 | /** 288 | * This mode will only send click and the event will be sent directly on buttonDown. 289 | * This will be the same as listening for buttonDown. 290 | * 291 | * Note: This is optimal if your application requires the lowest latency possible. 292 | */ 293 | FLICButtonTriggerModeClick, 294 | }; 295 | 296 | /*! 297 | * @enum FLICButtonTriggerMode 298 | * 299 | * @discussion The different latency modes that you can configure the Flic button to use. 300 | * 301 | */ 302 | typedef NS_ENUM(NSInteger, FLICLatencyMode) 303 | { 304 | /** 305 | * This is the default mode of the button. It will give you a good compromise between click latency (less than 105 ms while connected) and current consumption. 306 | */ 307 | FLICLatencyModeNormal = 0, 308 | /** 309 | * Using this mode will give your button the lowest possible click latency (typicaly less than 30 ms while connected). 310 | * This mode will significantly increase the current consumption. 311 | */ 312 | FLICLatencyModeLow, 313 | }; 314 | 315 | #endif /* FLICEnums_h */ 316 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Versions/A/Headers/FLICEnums.h: -------------------------------------------------------------------------------- 1 | // 2 | // FLICEnums.h 3 | // fliclib 4 | // 5 | // Created by Anton Meier on 2019-04-18. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #ifndef FLICEnums_h 10 | #define FLICEnums_h 11 | 12 | extern NSString * const FLICErrorDomain; 13 | extern NSString * const FLICButtonScannerErrorDomain; 14 | 15 | /*! 16 | * @enum FLICManagerState 17 | * 18 | * @discussion Represents the the different states that a Flic manager can be in at any given time. These states are mostly translated values of Apple's CoreBluetooth CBManagerState enums. 19 | * 20 | */ 21 | typedef NS_ENUM(NSInteger, FLICManagerState) 22 | { 23 | /** 24 | * State is unknown, update imminent. 25 | */ 26 | FLICManagerStateUnknown = 0, 27 | /** 28 | * The bluetooth connection with the system service was momentarily lost, update imminent. 29 | */ 30 | FLICManagerStateResetting, 31 | /** 32 | * The Flic manager can not be used on this platform. 33 | */ 34 | FLICManagerStateUnsupported, 35 | /** 36 | * The application is not authorized to use Bluetooth Low Energy. 37 | */ 38 | FLICManagerStateUnauthorized, 39 | /** 40 | * Bluetooth is currently powered off. 41 | */ 42 | FLICManagerStatePoweredOff, 43 | /** 44 | * Bluetooth is currently powered on and available to use. 45 | */ 46 | FLICManagerStatePoweredOn 47 | }; 48 | 49 | /*! 50 | * @enum FLICButtonScannerErrorCode 51 | * 52 | * @discussion Represents the different error codes that can be generated while scanning and pairing new Flics. 53 | * 54 | */ 55 | typedef NS_ENUM(NSInteger, FLICButtonScannerErrorCode) 56 | { 57 | /** 58 | * The scan was unsuccessful due to an unknown reason. 59 | */ 60 | FLICButtonScannerErrorCodeUnknown = 0, 61 | /** 62 | * The scan could not be started since bluetooth was not in the powered on state. 63 | */ 64 | FLICButtonScannerErrorCodeBluetoothNotActivated, 65 | /** 66 | * No button was advertising in public mode within proximity. 67 | */ 68 | FLICButtonScannerErrorCodeNoPublicButtonDiscovered, 69 | /** 70 | * The bluetooth pairing failed since the user already has paired this button before with this device. 71 | * This is solved by removing the pairing from the iOS bluetooth pairing settings screen. 72 | */ 73 | FLICButtonScannerErrorCodeBLEPairingFailedPreviousPairingAlreadyExisting, 74 | /** 75 | * The bluetooth pairing failed since the user pressed cancel on the pairing dialog. 76 | */ 77 | FLICButtonScannerErrorCodeBLEPairingFailedUserCanceled, 78 | /** 79 | * The bluetooth pairing failed since iOS decided to decline the request. It is unknown why or if this can happen. 80 | */ 81 | FLICButtonScannerErrorCodeBLEPairingFailedUnknownReason, 82 | /** 83 | * Indicates that the button cannot be unlocked since it belongs to a different brand. 84 | */ 85 | FLICButtonScannerErrorCodeAppCredentialsDontMatch, 86 | /** 87 | * The scan was manually canceled using the stopScan method. 88 | */ 89 | FLICButtonScannerErrorCodeUserCanceled, 90 | /** 91 | * The Flic's certificate belongs to a different bluetooth address. 92 | */ 93 | FLICButtonScannerErrorCodeInvalidBluetoothAddress, 94 | /** 95 | * The framework was unable to pair with the Flic since it did not pass the authenticity check. 96 | */ 97 | FLICButtonScannerErrorCodeGenuineCheckFailed, 98 | /** 99 | * The discovered Flic cannot be connected since it is currently connected to a different device. 100 | */ 101 | FLICButtonScannerErrorCodeAlreadyConnectedToAnotherDevice, 102 | /** 103 | * The discovered Flic cannot be connected since the maximum number of simultaneous app connections has been reached. 104 | */ 105 | FLICButtonScannerErrorCodeTooManyApps, 106 | /** 107 | * A bluetooth specific error. The framework was unable to establish a connection to the Flic peripheral. 108 | */ 109 | FLICButtonScannerErrorCodeCouldNotSetBluetoothNotify, 110 | /** 111 | * A bluetooth specific error. The framework was unable to establish a connection to the Flic peripheral. 112 | */ 113 | FLICButtonScannerErrorCodeCouldNotDiscoverBluetoothServices, 114 | /** 115 | * The bluetooth connection was dropped during the verification process. 116 | */ 117 | FLICButtonScannerErrorCodeButtonDisconnectedDuringVerification, 118 | /** 119 | * The Flic peripheral connection was unexpectedly lost. 120 | */ 121 | FLICButtonScannerErrorCodeConnectionTimeout, 122 | /** 123 | * The bluetooth connection failed. 124 | */ 125 | FLICButtonScannerErrorCodeFailedToEstablish, 126 | /** 127 | * The iOS device reached the maximum number of allowed bluetooth peripherals. 128 | */ 129 | FLICButtonScannerErrorCodeConnectionLimitReached, 130 | /** 131 | * The signature generated by the Flic button could not be verified. 132 | */ 133 | FLICButtonScannerErrorCodeInvalidVerifier, 134 | /** 135 | * The Flic button was no longer in public mode when the verification process ran. 136 | */ 137 | FLICButtonScannerErrorCodeNotInPublicMode, 138 | }; 139 | 140 | /*! 141 | * @enum FLICButtonScannerStatusEvent 142 | * 143 | * @discussion While the scanner is running, it will send a status events to let you know what it is doing. These enums represents those events. 144 | * 145 | */ 146 | typedef NS_ENUM(NSInteger, FLICButtonScannerStatusEvent) 147 | { 148 | /** 149 | * A public Flic has been discovered and a connection attempt will now be made. 150 | */ 151 | FLICButtonScannerStatusEventDiscovered = 0, 152 | /** 153 | * The Flic was successfully bluetooth connected. 154 | */ 155 | FLICButtonScannerStatusEventConnected, 156 | /** 157 | * The Flic has been verified and unlocked for this app. The Flic will soon be delivered in the assigned completion handler. 158 | */ 159 | FLICButtonScannerStatusEventVerified, 160 | /** 161 | * The Flic could not be verified. The completion handler will soon run to let you know what the error was. 162 | */ 163 | FLICButtonScannerStatusEventVerificationFailed, 164 | }; 165 | 166 | /*! 167 | * @enum FLICError 168 | * 169 | * @discussion These enums represents the different error codes that can be sent from flic2lib, excluding the button scanner which has its own set of error codes. 170 | * 171 | */ 172 | typedef NS_ENUM(NSInteger, FLICError) 173 | { 174 | /** 175 | * An unknown error has occurred. 176 | */ 177 | FLICErrorUnknown = 0, 178 | /** 179 | * You are trying to use the manager while it has not been configured yet. 180 | */ 181 | FLICErrorNotConfigured, 182 | /** 183 | * A bluetooth specific error code. This means that something went wrong while the phone tried to establish a connection with the Flic peripheral. 184 | */ 185 | FLICErrorCouldNotDiscoverBluetoothServices, 186 | /** 187 | * The framework was unable to verify the cryptographic signature from the Flic while setting up a session. 188 | */ 189 | FLICErrorVerificationSignatureMismatch, 190 | /** 191 | * The UUID of a button is not correct. 192 | */ 193 | FLICErrorInvalidUuid, 194 | /** 195 | * While establishing a connection with the Flic the framework was unable to verify the authenticity of the button. 196 | */ 197 | FLICErrorGenuineCheckFailed, 198 | /** 199 | * The app was unable to establish a connection with the Flic button because it already had a connection with too many apps on this particular phone. 200 | */ 201 | FLICErrorTooManyApps, 202 | /** 203 | * The pairing on the Flic button has been lost so the app's pairing data is no longer valid. This typically happens if the Flic is factory reset. 204 | */ 205 | FLICErrorUnpaired, 206 | /** 207 | * The manager was unable to complete the task since the device is not running on a supported iOS version. 208 | */ 209 | FLICErrorUnsupportedOSVersion, 210 | /** 211 | * You are trying to use a FLICButton object that has already been forgotten by the manager. Please discard of your references to this object. 212 | */ 213 | FLICErrorAlreadyForgotten, 214 | }; 215 | 216 | /*! 217 | * @enum FLICButtonState 218 | * 219 | * @discussion The different states that a Flic can be in at any given time. 220 | * 221 | */ 222 | typedef NS_ENUM(NSInteger, FLICButtonState) 223 | { 224 | /** 225 | * The Flic is currently disconnected and a pending connection is not set. The Flic will not connect again unless you manually call the connect method. 226 | */ 227 | FLICButtonStateDisconnected = 0, 228 | /** 229 | * The Flic is currently disconnected, but a pending connection is set. The Flic will automatically connect again as soon as it becomes available. 230 | */ 231 | FLICButtonStateConnecting, 232 | /** 233 | * The Flic currently has a bluetooth connection with the phone. This does not necessarily mean that it has been verified. 234 | * Please listen for the isReady event, or read the isReady property, for that information 235 | */ 236 | FLICButtonStateConnected, 237 | /** 238 | * The Flic is currently connected, but is attempting to disconnect. Typically this state will only occur for very short periods of time before either switching to 239 | * the connecting or disconnected state again. 240 | */ 241 | FLICButtonStateDisconnecting, 242 | }; 243 | 244 | /*! 245 | * @enum FLICButtonTriggerMode 246 | * 247 | * @discussion The different trigger modes that you can configure the Flic button to use. Please make sure that you understand how these work. 248 | * The choosen trigger mode will affect the latency on the press events coming from the Flic button. 249 | * 250 | */ 251 | typedef NS_ENUM(NSInteger, FLICButtonTriggerMode) 252 | { 253 | /** 254 | * Used to distinguish between only click and hold. 255 | * 256 | * Click will be fired when the button is released if it was pressed for maximum 1 second. 257 | * Otherwise, hold will be fired 1 second after the button was pressed. Click will then not be fired upon release. 258 | * Since this option will only distinguish between click and hold it does not have to take double click into consideration. 259 | * This means that the click event can be sent immediately on button release rather than to wait for a possible double click. 260 | * 261 | * Note: this will be the default behavior. 262 | */ 263 | FLICButtonTriggerModeClickAndHold = 0, 264 | /** 265 | * Used to distinguish between only single click and double click. 266 | * 267 | * Double click will be registered if the time between two button down events was at most 0.5 seconds. 268 | * The double click event will then be fired upon button release. 269 | * 270 | * If the time was more than 0.5 seconds, a single click event will be fired; either directly upon button release if the button was down 271 | * for more than 0.5 seconds, or after 0.5 seconds if the button was down for less than 0.5 seconds. 272 | */ 273 | FLICButtonTriggerModeClickAndDoubleClick, 274 | /** 275 | * Used to distinguish between single click, double click and hold. 276 | * 277 | * If the time between the first button down and button up event was more than 1 second, a hold event will be fired. 278 | * Else, double click will be fired if the time between two button down events was at most 0.5 seconds. 279 | * The double click event will then be fired upon button release. 280 | * 281 | * If the time was more than 0.5 seconds, a single click event will be fired; either directly upon button release if the button was down 282 | * for more than 0.5 seconds, or after 0.5 seconds if the button was down for less than 0.5 seconds. 283 | * 284 | * Note: Three fast consecutive clicks means one double click and then one single click. Four fast consecutive clicks means two double clicks. 285 | */ 286 | FLICButtonTriggerModeClickAndDoubleClickAndHold, 287 | /** 288 | * This mode will only send click and the event will be sent directly on buttonDown. 289 | * This will be the same as listening for buttonDown. 290 | * 291 | * Note: This is optimal if your application requires the lowest latency possible. 292 | */ 293 | FLICButtonTriggerModeClick, 294 | }; 295 | 296 | /*! 297 | * @enum FLICButtonTriggerMode 298 | * 299 | * @discussion The different latency modes that you can configure the Flic button to use. 300 | * 301 | */ 302 | typedef NS_ENUM(NSInteger, FLICLatencyMode) 303 | { 304 | /** 305 | * This is the default mode of the button. It will give you a good compromise between click latency (less than 105 ms while connected) and current consumption. 306 | */ 307 | FLICLatencyModeNormal = 0, 308 | /** 309 | * Using this mode will give your button the lowest possible click latency (typicaly less than 30 ms while connected). 310 | * This mode will significantly increase the current consumption. 311 | */ 312 | FLICLatencyModeLow, 313 | }; 314 | 315 | #endif /* FLICEnums_h */ 316 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64/flic2lib.framework/Headers/FLICButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // FLICButton.h 3 | // flic2lib 4 | // 5 | // Created by Anton Meier on 2019-04-11. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @protocol FLICButtonDelegate; 15 | 16 | /*! 17 | * @class FLICButton 18 | * 19 | * @discussion An instance of this class represents a physical Flic. 20 | * 21 | */ 22 | @interface FLICButton : NSObject 23 | 24 | /*! 25 | * @property identifier 26 | * 27 | * @discussion This identifier is guaranteed to be the same for each Flic paired to a particular iOS device. Thus it can be used to identify a Flic within an app. 28 | * However, If you need to identify Flics cross different apps on different iOS devices, then you should have look at the either uuid, serialNumber, or bluetoothAddress. 29 | * 30 | */ 31 | @property(readonly, nonatomic, strong, nonnull) NSUUID *identifier; 32 | 33 | /*! 34 | * @property delegate 35 | * 36 | * @discussion The delegate that will receive events related to this particular Flic. 37 | * You can either set this delegate manually for each button, or let the manager do so automatically using the buttonDelegate as default. 38 | * 39 | */ 40 | @property(weak, nonatomic, nullable) id delegate; 41 | 42 | /*! 43 | * @property name 44 | * 45 | * @discussion The bluetooth advertisement name of the Flic. This will be the same name that is shown by iOS it its bluetooth settings. 46 | * 47 | */ 48 | @property(nonatomic, readonly, strong, nullable) NSString *name; 49 | 50 | /*! 51 | * @property nickname 52 | * 53 | * @discussion With this property you can read out the display name that the user may change in for example the Flic app. This value can also be changed from third party apps 54 | * integrating this framework (including your app). The purpose of this is to provide more human readable name that the user can use to identify its Flic's across apps. 55 | * For example "Kitchen Flic" or "Bedroom Lights". The nickname has a maximum length limit of 23 bytes. Keep in mind that this is the length in bytes, and not the 56 | * number of UTF8 characters (which may be up to 4 bytes long). If you write anything longer than 23 bytes then the nickname will automatically be truncated to at 57 | * most 23 bytes. When truncating the string, the framework will always cut between UTF8 character, so you don't have to worry about writing half an emoji, for example. 58 | * 59 | */ 60 | @property(nonatomic, readwrite, strong, nullable) NSString *nickname; 61 | 62 | /*! 63 | * @property bluetoothAddress 64 | * 65 | * @discussion The bluetooth address of the Flic. This will be a string representation of a 49 bit long address. Example: "00:80:e4:da:12:34:56" 66 | * 67 | */ 68 | @property(nonatomic, readonly, strong, nonnull) NSString *bluetoothAddress; 69 | 70 | /*! 71 | * @property uuid 72 | * 73 | * @discussion This is a unique identifier string that best used to identify a Flic. This is for example used to identify Flics on all our API endpoints. 74 | * 75 | */ 76 | @property(nonatomic, readonly, strong, nonnull) NSString *uuid; 77 | 78 | /*! 79 | * @property serialNumber 80 | * 81 | * @discussion The serial number is a production identifier that is printed on the backside of the Flic inside the battery hatch. 82 | * This serves no other purpose than allowing a user to identify a button by manually looking at it. Can be useful in some cases. 83 | * 84 | */ 85 | @property(nonatomic, readonly, strong, nonnull) NSString *serialNumber; 86 | 87 | /*! 88 | * @property triggerMode 89 | * 90 | * @discussion Use this property to let the flic2lib know what type of click events you are interested it. By default you will get Click, Double Click and Hold events. 91 | * However, if you for example are only interested in Click events then you can set this property to FLICButtonTriggerModeClick. Doing so will allow the flic2lib to 92 | * deliver the events quicker since it can now ignore Double Click and Hold. 93 | * 94 | */ 95 | @property(nonatomic, readwrite) FLICButtonTriggerMode triggerMode; 96 | 97 | /*! 98 | * @property state 99 | * 100 | * @discussion Lets you know if the Flic is Connected, Disconnected, Connecting, or Disconnecting. 101 | * 102 | */ 103 | @property(nonatomic, readonly) FLICButtonState state; 104 | 105 | /*! 106 | * @property pressCount 107 | * 108 | * @discussion The number of times the Flic has been clicked since last time it booted. 109 | * 110 | */ 111 | @property(nonatomic, readonly) uint32_t pressCount; 112 | 113 | /*! 114 | * @property firmwareRevision 115 | * 116 | * @discussion The revision of the firmware currently running on the Flic. 117 | * 118 | */ 119 | @property(nonatomic, readonly) uint32_t firmwareRevision; 120 | 121 | /*! 122 | * @property isReady 123 | * 124 | * @discussion When a Flic connects it will go through a quick cryptographic verification to ensure that it is both a genuine Flic and that it is the correct Flic. 125 | * Once this is completed this property will be set to YES and it is not until after that that you will start receiving click events (if any). As soon as the button disconnects 126 | * this will be set to NO again. 127 | * 128 | */ 129 | @property(nonatomic, readonly) BOOL isReady; 130 | 131 | /*! 132 | * @property batteryVoltage 133 | * 134 | * @discussion This will be the last know battery sample taken on the Flic. If this value is 0 then you should assume that no sample has yet been taken. It is important to know that 135 | * the voltage may fluctuate depending on many different factors, such as temperature and workload. For example, heavy usage of the LED will temporarily lower the voltage, 136 | * but it is likely to recover shortly after. Therefore we do not recomend to exactly translate this value into a battery percentage, instead consider showing a 137 | * "change the battery soon"-status in your app once the voltage goes below 2.65V. 138 | * 139 | */ 140 | @property(nonatomic, readonly) float batteryVoltage; 141 | 142 | /*! 143 | * @property isUnpaired 144 | * 145 | * @discussion If this property is YES, then it means that this app's pairing with this specific Flic is no longer valid. This can for example occur if the Flic has been factory reset, 146 | * or if the maximum number of pairings have been reached. In this case you will need to delete the button from the manager and then scan for it again. 147 | * 148 | */ 149 | @property(nonatomic, readonly) BOOL isUnpaired; 150 | 151 | /*! 152 | * @property latencyMode 153 | * 154 | * @discussion Lets you switch between two different latency modes. For most use-cases it is recommend to keep the default FLICLatencyModeNormal. 155 | * FLICLatencyModeLow should ideally only be used for foreground applications, such as games, where low latency is needed. Keep in mind that the 156 | * energy consumption will be significantly higher in the low latency mode. 157 | * 158 | */ 159 | @property(nonatomic, readwrite) FLICLatencyMode latencyMode; 160 | 161 | /*! 162 | * @method connect 163 | * 164 | * @discussion Attempts to connect the Flic. If the Flic is not available, due to either being out of range or not advertising, then it will be connected once it becomes 165 | * available as this call does not time out. This is often called a pending connection. It can be canceled by calling disconnect. 166 | * 167 | */ 168 | - (void)connect; 169 | 170 | /*! 171 | * @method disconnect 172 | * 173 | * @discussion Disconnect a currently connected Flic or cancel a pending connection. 174 | * 175 | */ 176 | - (void)disconnect; 177 | 178 | @end 179 | 180 | /*! 181 | * @protocol FLICButtonDelegate 182 | * 183 | * @discussion The delegate of a FLICButton instance must adopt the FLICButtonDelegate protocol. All calls to the delegate methods will be on the main dispatch queue. 184 | * 185 | */ 186 | @protocol FLICButtonDelegate 187 | 188 | /*! 189 | * @method buttonDidConnect: 190 | * 191 | * @param button The FLICButton instance that the event originated from. 192 | * 193 | * @discussion This method is called every time the Flic establishes a new bluetooth connection. Keep in mind that you also have to wait for the buttonIsReady: before 194 | * the Flic is ready to be used. 195 | * 196 | */ 197 | - (void)buttonDidConnect:(FLICButton *)button; 198 | 199 | /*! 200 | * @method buttonIsReady: 201 | * 202 | * @param button The FLICButton instance that the event originated from. 203 | * 204 | * @discussion This method is called after each connection once the Flic has been cryptographically verified. You will not receive any click events before this is called. 205 | * 206 | */ 207 | - (void)buttonIsReady:(FLICButton *)button; 208 | 209 | /*! 210 | * @method button:didDisconnectWithError: 211 | * 212 | * @param button The FLICButton instance that the event originated from. 213 | * @param error This error lets you know the reason for the disconnect. An error does not necessarily mean that something went wrong. 214 | * 215 | * @discussion This method is called every time the bluetooth link with the Flic is lost. This can occur for several different reasons. The most common would be that 216 | * the iOS device and the Flic is no longer within range of each other. 217 | * 218 | */ 219 | - (void)button:(FLICButton *)button didDisconnectWithError:(NSError * _Nullable)error; 220 | 221 | /*! 222 | * @method button:didFailToConnectWithError: 223 | * 224 | * @param button The FLICButton instance that the event originated from. 225 | * @param error This error lets you know why the connection attempt failed. 226 | * 227 | * @discussion This method is called when a connection attempt to a button fails. This indicates that something has gone wrong and that the pending connection will not be reset. 228 | * 229 | */ 230 | - (void)button:(FLICButton *)button didFailToConnectWithError:(NSError * _Nullable)error; 231 | 232 | @optional 233 | 234 | /*! 235 | * @method button:didReceiveButtonDown:age: 236 | * 237 | * @param button The FLICButton instance that the event originated from. 238 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 239 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 240 | * 241 | * @discussion The Flic registered a button down event. 242 | * 243 | */ 244 | - (void)button:(FLICButton *)button didReceiveButtonDown:(BOOL)queued age:(NSInteger)age; 245 | 246 | /*! 247 | * @method button:didReceiveButtonUp:age: 248 | * 249 | * @param button The FLICButton instance that the event originated from. 250 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 251 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 252 | * 253 | * @discussion The Flic registered a button up event. 254 | * 255 | */ 256 | - (void)button:(FLICButton *)button didReceiveButtonUp:(BOOL)queued age:(NSInteger)age; 257 | 258 | /*! 259 | * @method button:didReceiveButtonClick:age: 260 | * 261 | * @param button The FLICButton instance that the event originated from. 262 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 263 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 264 | * 265 | * @discussion The Flic registered a button click event. 266 | * 267 | */ 268 | - (void)button:(FLICButton *)button didReceiveButtonClick:(BOOL)queued age:(NSInteger)age; 269 | 270 | /*! 271 | * @method button:didReceiveButtonDoubleClick:age: 272 | * 273 | * @param button The FLICButton instance that the event originated from. 274 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 275 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 276 | * 277 | * @discussion The Flic registered a double click event. 278 | * 279 | */ 280 | - (void)button:(FLICButton *)button didReceiveButtonDoubleClick:(BOOL)queued age:(NSInteger)age; 281 | 282 | /*! 283 | * @method button:didReceiveButtonHold:age: 284 | * 285 | * @param button The FLICButton instance that the event originated from. 286 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 287 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 288 | * 289 | * @discussion The Flic registered a button hold event. 290 | * 291 | */ 292 | - (void)button:(FLICButton *)button didReceiveButtonHold:(BOOL)queued age:(NSInteger)age; 293 | 294 | /*! 295 | * @method button:didUnpairWithError: 296 | * 297 | * @param button The FLICButton instance that the event originated from. 298 | * @param error This will always be nil at this time. 299 | * 300 | * @discussion The app no longer has a valid pairing with the Flic button. The isUnpaired property will now be YES and all connection 301 | * attempts made will immediately fail. To fix this you need to delete the button from the manager and then re-scan it again. 302 | * 303 | */ 304 | - (void)button:(FLICButton *)button didUnpairWithError:(NSError * _Nullable)error; 305 | 306 | /*! 307 | * @method button:didUpdateBatteryVoltage: 308 | * 309 | * @param button The FLICButton instance that the event originated from. 310 | * @param voltage Float representation of the latest battery voltage sample. 311 | * 312 | * @discussion This callback will be sent once the Flic button updates its battery voltage with a new value. Typically this will occurs a few seconds 313 | * after the button connects. If you show a battery indicator in you app, then this would be a good place to refresh your UI. Please 314 | * see the description for the batteryVoltage property for more information. 315 | * 316 | */ 317 | - (void)button:(FLICButton *)button didUpdateBatteryVoltage:(float)voltage; 318 | 319 | /*! 320 | * @method button:didUpdateNickname: 321 | * 322 | * @param button The FLICButton instance that the event originated from. 323 | * @param nickname The new nickname that was sent from the Flic. 324 | * 325 | * @discussion If the nickname is updated by another app (including the official Flic app), then you will get this callback letting you know that the 326 | * name has changed. This may either be in real time (if multiple apps are connected at the same time), or a deayed event that 327 | * occurs after the button connects (if the nickname was changed while your app was not active). If your app displays this nickname, 328 | * then this would be a good place to refresh your UI. 329 | * 330 | */ 331 | - (void)button:(FLICButton *)button didUpdateNickname:(NSString *)nickname; 332 | 333 | @end 334 | 335 | NS_ASSUME_NONNULL_END 336 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-simulator/flic2lib.framework/Headers/FLICButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // FLICButton.h 3 | // flic2lib 4 | // 5 | // Created by Anton Meier on 2019-04-11. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @protocol FLICButtonDelegate; 15 | 16 | /*! 17 | * @class FLICButton 18 | * 19 | * @discussion An instance of this class represents a physical Flic. 20 | * 21 | */ 22 | @interface FLICButton : NSObject 23 | 24 | /*! 25 | * @property identifier 26 | * 27 | * @discussion This identifier is guaranteed to be the same for each Flic paired to a particular iOS device. Thus it can be used to identify a Flic within an app. 28 | * However, If you need to identify Flics cross different apps on different iOS devices, then you should have look at the either uuid, serialNumber, or bluetoothAddress. 29 | * 30 | */ 31 | @property(readonly, nonatomic, strong, nonnull) NSUUID *identifier; 32 | 33 | /*! 34 | * @property delegate 35 | * 36 | * @discussion The delegate that will receive events related to this particular Flic. 37 | * You can either set this delegate manually for each button, or let the manager do so automatically using the buttonDelegate as default. 38 | * 39 | */ 40 | @property(weak, nonatomic, nullable) id delegate; 41 | 42 | /*! 43 | * @property name 44 | * 45 | * @discussion The bluetooth advertisement name of the Flic. This will be the same name that is shown by iOS it its bluetooth settings. 46 | * 47 | */ 48 | @property(nonatomic, readonly, strong, nullable) NSString *name; 49 | 50 | /*! 51 | * @property nickname 52 | * 53 | * @discussion With this property you can read out the display name that the user may change in for example the Flic app. This value can also be changed from third party apps 54 | * integrating this framework (including your app). The purpose of this is to provide more human readable name that the user can use to identify its Flic's across apps. 55 | * For example "Kitchen Flic" or "Bedroom Lights". The nickname has a maximum length limit of 23 bytes. Keep in mind that this is the length in bytes, and not the 56 | * number of UTF8 characters (which may be up to 4 bytes long). If you write anything longer than 23 bytes then the nickname will automatically be truncated to at 57 | * most 23 bytes. When truncating the string, the framework will always cut between UTF8 character, so you don't have to worry about writing half an emoji, for example. 58 | * 59 | */ 60 | @property(nonatomic, readwrite, strong, nullable) NSString *nickname; 61 | 62 | /*! 63 | * @property bluetoothAddress 64 | * 65 | * @discussion The bluetooth address of the Flic. This will be a string representation of a 49 bit long address. Example: "00:80:e4:da:12:34:56" 66 | * 67 | */ 68 | @property(nonatomic, readonly, strong, nonnull) NSString *bluetoothAddress; 69 | 70 | /*! 71 | * @property uuid 72 | * 73 | * @discussion This is a unique identifier string that best used to identify a Flic. This is for example used to identify Flics on all our API endpoints. 74 | * 75 | */ 76 | @property(nonatomic, readonly, strong, nonnull) NSString *uuid; 77 | 78 | /*! 79 | * @property serialNumber 80 | * 81 | * @discussion The serial number is a production identifier that is printed on the backside of the Flic inside the battery hatch. 82 | * This serves no other purpose than allowing a user to identify a button by manually looking at it. Can be useful in some cases. 83 | * 84 | */ 85 | @property(nonatomic, readonly, strong, nonnull) NSString *serialNumber; 86 | 87 | /*! 88 | * @property triggerMode 89 | * 90 | * @discussion Use this property to let the flic2lib know what type of click events you are interested it. By default you will get Click, Double Click and Hold events. 91 | * However, if you for example are only interested in Click events then you can set this property to FLICButtonTriggerModeClick. Doing so will allow the flic2lib to 92 | * deliver the events quicker since it can now ignore Double Click and Hold. 93 | * 94 | */ 95 | @property(nonatomic, readwrite) FLICButtonTriggerMode triggerMode; 96 | 97 | /*! 98 | * @property state 99 | * 100 | * @discussion Lets you know if the Flic is Connected, Disconnected, Connecting, or Disconnecting. 101 | * 102 | */ 103 | @property(nonatomic, readonly) FLICButtonState state; 104 | 105 | /*! 106 | * @property pressCount 107 | * 108 | * @discussion The number of times the Flic has been clicked since last time it booted. 109 | * 110 | */ 111 | @property(nonatomic, readonly) uint32_t pressCount; 112 | 113 | /*! 114 | * @property firmwareRevision 115 | * 116 | * @discussion The revision of the firmware currently running on the Flic. 117 | * 118 | */ 119 | @property(nonatomic, readonly) uint32_t firmwareRevision; 120 | 121 | /*! 122 | * @property isReady 123 | * 124 | * @discussion When a Flic connects it will go through a quick cryptographic verification to ensure that it is both a genuine Flic and that it is the correct Flic. 125 | * Once this is completed this property will be set to YES and it is not until after that that you will start receiving click events (if any). As soon as the button disconnects 126 | * this will be set to NO again. 127 | * 128 | */ 129 | @property(nonatomic, readonly) BOOL isReady; 130 | 131 | /*! 132 | * @property batteryVoltage 133 | * 134 | * @discussion This will be the last know battery sample taken on the Flic. If this value is 0 then you should assume that no sample has yet been taken. It is important to know that 135 | * the voltage may fluctuate depending on many different factors, such as temperature and workload. For example, heavy usage of the LED will temporarily lower the voltage, 136 | * but it is likely to recover shortly after. Therefore we do not recomend to exactly translate this value into a battery percentage, instead consider showing a 137 | * "change the battery soon"-status in your app once the voltage goes below 2.65V. 138 | * 139 | */ 140 | @property(nonatomic, readonly) float batteryVoltage; 141 | 142 | /*! 143 | * @property isUnpaired 144 | * 145 | * @discussion If this property is YES, then it means that this app's pairing with this specific Flic is no longer valid. This can for example occur if the Flic has been factory reset, 146 | * or if the maximum number of pairings have been reached. In this case you will need to delete the button from the manager and then scan for it again. 147 | * 148 | */ 149 | @property(nonatomic, readonly) BOOL isUnpaired; 150 | 151 | /*! 152 | * @property latencyMode 153 | * 154 | * @discussion Lets you switch between two different latency modes. For most use-cases it is recommend to keep the default FLICLatencyModeNormal. 155 | * FLICLatencyModeLow should ideally only be used for foreground applications, such as games, where low latency is needed. Keep in mind that the 156 | * energy consumption will be significantly higher in the low latency mode. 157 | * 158 | */ 159 | @property(nonatomic, readwrite) FLICLatencyMode latencyMode; 160 | 161 | /*! 162 | * @method connect 163 | * 164 | * @discussion Attempts to connect the Flic. If the Flic is not available, due to either being out of range or not advertising, then it will be connected once it becomes 165 | * available as this call does not time out. This is often called a pending connection. It can be canceled by calling disconnect. 166 | * 167 | */ 168 | - (void)connect; 169 | 170 | /*! 171 | * @method disconnect 172 | * 173 | * @discussion Disconnect a currently connected Flic or cancel a pending connection. 174 | * 175 | */ 176 | - (void)disconnect; 177 | 178 | @end 179 | 180 | /*! 181 | * @protocol FLICButtonDelegate 182 | * 183 | * @discussion The delegate of a FLICButton instance must adopt the FLICButtonDelegate protocol. All calls to the delegate methods will be on the main dispatch queue. 184 | * 185 | */ 186 | @protocol FLICButtonDelegate 187 | 188 | /*! 189 | * @method buttonDidConnect: 190 | * 191 | * @param button The FLICButton instance that the event originated from. 192 | * 193 | * @discussion This method is called every time the Flic establishes a new bluetooth connection. Keep in mind that you also have to wait for the buttonIsReady: before 194 | * the Flic is ready to be used. 195 | * 196 | */ 197 | - (void)buttonDidConnect:(FLICButton *)button; 198 | 199 | /*! 200 | * @method buttonIsReady: 201 | * 202 | * @param button The FLICButton instance that the event originated from. 203 | * 204 | * @discussion This method is called after each connection once the Flic has been cryptographically verified. You will not receive any click events before this is called. 205 | * 206 | */ 207 | - (void)buttonIsReady:(FLICButton *)button; 208 | 209 | /*! 210 | * @method button:didDisconnectWithError: 211 | * 212 | * @param button The FLICButton instance that the event originated from. 213 | * @param error This error lets you know the reason for the disconnect. An error does not necessarily mean that something went wrong. 214 | * 215 | * @discussion This method is called every time the bluetooth link with the Flic is lost. This can occur for several different reasons. The most common would be that 216 | * the iOS device and the Flic is no longer within range of each other. 217 | * 218 | */ 219 | - (void)button:(FLICButton *)button didDisconnectWithError:(NSError * _Nullable)error; 220 | 221 | /*! 222 | * @method button:didFailToConnectWithError: 223 | * 224 | * @param button The FLICButton instance that the event originated from. 225 | * @param error This error lets you know why the connection attempt failed. 226 | * 227 | * @discussion This method is called when a connection attempt to a button fails. This indicates that something has gone wrong and that the pending connection will not be reset. 228 | * 229 | */ 230 | - (void)button:(FLICButton *)button didFailToConnectWithError:(NSError * _Nullable)error; 231 | 232 | @optional 233 | 234 | /*! 235 | * @method button:didReceiveButtonDown:age: 236 | * 237 | * @param button The FLICButton instance that the event originated from. 238 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 239 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 240 | * 241 | * @discussion The Flic registered a button down event. 242 | * 243 | */ 244 | - (void)button:(FLICButton *)button didReceiveButtonDown:(BOOL)queued age:(NSInteger)age; 245 | 246 | /*! 247 | * @method button:didReceiveButtonUp:age: 248 | * 249 | * @param button The FLICButton instance that the event originated from. 250 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 251 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 252 | * 253 | * @discussion The Flic registered a button up event. 254 | * 255 | */ 256 | - (void)button:(FLICButton *)button didReceiveButtonUp:(BOOL)queued age:(NSInteger)age; 257 | 258 | /*! 259 | * @method button:didReceiveButtonClick:age: 260 | * 261 | * @param button The FLICButton instance that the event originated from. 262 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 263 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 264 | * 265 | * @discussion The Flic registered a button click event. 266 | * 267 | */ 268 | - (void)button:(FLICButton *)button didReceiveButtonClick:(BOOL)queued age:(NSInteger)age; 269 | 270 | /*! 271 | * @method button:didReceiveButtonDoubleClick:age: 272 | * 273 | * @param button The FLICButton instance that the event originated from. 274 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 275 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 276 | * 277 | * @discussion The Flic registered a double click event. 278 | * 279 | */ 280 | - (void)button:(FLICButton *)button didReceiveButtonDoubleClick:(BOOL)queued age:(NSInteger)age; 281 | 282 | /*! 283 | * @method button:didReceiveButtonHold:age: 284 | * 285 | * @param button The FLICButton instance that the event originated from. 286 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 287 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 288 | * 289 | * @discussion The Flic registered a button hold event. 290 | * 291 | */ 292 | - (void)button:(FLICButton *)button didReceiveButtonHold:(BOOL)queued age:(NSInteger)age; 293 | 294 | /*! 295 | * @method button:didUnpairWithError: 296 | * 297 | * @param button The FLICButton instance that the event originated from. 298 | * @param error This will always be nil at this time. 299 | * 300 | * @discussion The app no longer has a valid pairing with the Flic button. The isUnpaired property will now be YES and all connection 301 | * attempts made will immediately fail. To fix this you need to delete the button from the manager and then re-scan it again. 302 | * 303 | */ 304 | - (void)button:(FLICButton *)button didUnpairWithError:(NSError * _Nullable)error; 305 | 306 | /*! 307 | * @method button:didUpdateBatteryVoltage: 308 | * 309 | * @param button The FLICButton instance that the event originated from. 310 | * @param voltage Float representation of the latest battery voltage sample. 311 | * 312 | * @discussion This callback will be sent once the Flic button updates its battery voltage with a new value. Typically this will occurs a few seconds 313 | * after the button connects. If you show a battery indicator in you app, then this would be a good place to refresh your UI. Please 314 | * see the description for the batteryVoltage property for more information. 315 | * 316 | */ 317 | - (void)button:(FLICButton *)button didUpdateBatteryVoltage:(float)voltage; 318 | 319 | /*! 320 | * @method button:didUpdateNickname: 321 | * 322 | * @param button The FLICButton instance that the event originated from. 323 | * @param nickname The new nickname that was sent from the Flic. 324 | * 325 | * @discussion If the nickname is updated by another app (including the official Flic app), then you will get this callback letting you know that the 326 | * name has changed. This may either be in real time (if multiple apps are connected at the same time), or a deayed event that 327 | * occurs after the button connects (if the nickname was changed while your app was not active). If your app displays this nickname, 328 | * then this would be a good place to refresh your UI. 329 | * 330 | */ 331 | - (void)button:(FLICButton *)button didUpdateNickname:(NSString *)nickname; 332 | 333 | @end 334 | 335 | NS_ASSUME_NONNULL_END 336 | -------------------------------------------------------------------------------- /flic2lib.xcframework/ios-arm64_x86_64-maccatalyst/flic2lib.framework/Versions/A/Headers/FLICButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // FLICButton.h 3 | // flic2lib 4 | // 5 | // Created by Anton Meier on 2019-04-11. 6 | // Copyright © 2020 Shortcut Labs. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @protocol FLICButtonDelegate; 15 | 16 | /*! 17 | * @class FLICButton 18 | * 19 | * @discussion An instance of this class represents a physical Flic. 20 | * 21 | */ 22 | @interface FLICButton : NSObject 23 | 24 | /*! 25 | * @property identifier 26 | * 27 | * @discussion This identifier is guaranteed to be the same for each Flic paired to a particular iOS device. Thus it can be used to identify a Flic within an app. 28 | * However, If you need to identify Flics cross different apps on different iOS devices, then you should have look at the either uuid, serialNumber, or bluetoothAddress. 29 | * 30 | */ 31 | @property(readonly, nonatomic, strong, nonnull) NSUUID *identifier; 32 | 33 | /*! 34 | * @property delegate 35 | * 36 | * @discussion The delegate that will receive events related to this particular Flic. 37 | * You can either set this delegate manually for each button, or let the manager do so automatically using the buttonDelegate as default. 38 | * 39 | */ 40 | @property(weak, nonatomic, nullable) id delegate; 41 | 42 | /*! 43 | * @property name 44 | * 45 | * @discussion The bluetooth advertisement name of the Flic. This will be the same name that is shown by iOS it its bluetooth settings. 46 | * 47 | */ 48 | @property(nonatomic, readonly, strong, nullable) NSString *name; 49 | 50 | /*! 51 | * @property nickname 52 | * 53 | * @discussion With this property you can read out the display name that the user may change in for example the Flic app. This value can also be changed from third party apps 54 | * integrating this framework (including your app). The purpose of this is to provide more human readable name that the user can use to identify its Flic's across apps. 55 | * For example "Kitchen Flic" or "Bedroom Lights". The nickname has a maximum length limit of 23 bytes. Keep in mind that this is the length in bytes, and not the 56 | * number of UTF8 characters (which may be up to 4 bytes long). If you write anything longer than 23 bytes then the nickname will automatically be truncated to at 57 | * most 23 bytes. When truncating the string, the framework will always cut between UTF8 character, so you don't have to worry about writing half an emoji, for example. 58 | * 59 | */ 60 | @property(nonatomic, readwrite, strong, nullable) NSString *nickname; 61 | 62 | /*! 63 | * @property bluetoothAddress 64 | * 65 | * @discussion The bluetooth address of the Flic. This will be a string representation of a 49 bit long address. Example: "00:80:e4:da:12:34:56" 66 | * 67 | */ 68 | @property(nonatomic, readonly, strong, nonnull) NSString *bluetoothAddress; 69 | 70 | /*! 71 | * @property uuid 72 | * 73 | * @discussion This is a unique identifier string that best used to identify a Flic. This is for example used to identify Flics on all our API endpoints. 74 | * 75 | */ 76 | @property(nonatomic, readonly, strong, nonnull) NSString *uuid; 77 | 78 | /*! 79 | * @property serialNumber 80 | * 81 | * @discussion The serial number is a production identifier that is printed on the backside of the Flic inside the battery hatch. 82 | * This serves no other purpose than allowing a user to identify a button by manually looking at it. Can be useful in some cases. 83 | * 84 | */ 85 | @property(nonatomic, readonly, strong, nonnull) NSString *serialNumber; 86 | 87 | /*! 88 | * @property triggerMode 89 | * 90 | * @discussion Use this property to let the flic2lib know what type of click events you are interested it. By default you will get Click, Double Click and Hold events. 91 | * However, if you for example are only interested in Click events then you can set this property to FLICButtonTriggerModeClick. Doing so will allow the flic2lib to 92 | * deliver the events quicker since it can now ignore Double Click and Hold. 93 | * 94 | */ 95 | @property(nonatomic, readwrite) FLICButtonTriggerMode triggerMode; 96 | 97 | /*! 98 | * @property state 99 | * 100 | * @discussion Lets you know if the Flic is Connected, Disconnected, Connecting, or Disconnecting. 101 | * 102 | */ 103 | @property(nonatomic, readonly) FLICButtonState state; 104 | 105 | /*! 106 | * @property pressCount 107 | * 108 | * @discussion The number of times the Flic has been clicked since last time it booted. 109 | * 110 | */ 111 | @property(nonatomic, readonly) uint32_t pressCount; 112 | 113 | /*! 114 | * @property firmwareRevision 115 | * 116 | * @discussion The revision of the firmware currently running on the Flic. 117 | * 118 | */ 119 | @property(nonatomic, readonly) uint32_t firmwareRevision; 120 | 121 | /*! 122 | * @property isReady 123 | * 124 | * @discussion When a Flic connects it will go through a quick cryptographic verification to ensure that it is both a genuine Flic and that it is the correct Flic. 125 | * Once this is completed this property will be set to YES and it is not until after that that you will start receiving click events (if any). As soon as the button disconnects 126 | * this will be set to NO again. 127 | * 128 | */ 129 | @property(nonatomic, readonly) BOOL isReady; 130 | 131 | /*! 132 | * @property batteryVoltage 133 | * 134 | * @discussion This will be the last know battery sample taken on the Flic. If this value is 0 then you should assume that no sample has yet been taken. It is important to know that 135 | * the voltage may fluctuate depending on many different factors, such as temperature and workload. For example, heavy usage of the LED will temporarily lower the voltage, 136 | * but it is likely to recover shortly after. Therefore we do not recomend to exactly translate this value into a battery percentage, instead consider showing a 137 | * "change the battery soon"-status in your app once the voltage goes below 2.65V. 138 | * 139 | */ 140 | @property(nonatomic, readonly) float batteryVoltage; 141 | 142 | /*! 143 | * @property isUnpaired 144 | * 145 | * @discussion If this property is YES, then it means that this app's pairing with this specific Flic is no longer valid. This can for example occur if the Flic has been factory reset, 146 | * or if the maximum number of pairings have been reached. In this case you will need to delete the button from the manager and then scan for it again. 147 | * 148 | */ 149 | @property(nonatomic, readonly) BOOL isUnpaired; 150 | 151 | /*! 152 | * @property latencyMode 153 | * 154 | * @discussion Lets you switch between two different latency modes. For most use-cases it is recommend to keep the default FLICLatencyModeNormal. 155 | * FLICLatencyModeLow should ideally only be used for foreground applications, such as games, where low latency is needed. Keep in mind that the 156 | * energy consumption will be significantly higher in the low latency mode. 157 | * 158 | */ 159 | @property(nonatomic, readwrite) FLICLatencyMode latencyMode; 160 | 161 | /*! 162 | * @method connect 163 | * 164 | * @discussion Attempts to connect the Flic. If the Flic is not available, due to either being out of range or not advertising, then it will be connected once it becomes 165 | * available as this call does not time out. This is often called a pending connection. It can be canceled by calling disconnect. 166 | * 167 | */ 168 | - (void)connect; 169 | 170 | /*! 171 | * @method disconnect 172 | * 173 | * @discussion Disconnect a currently connected Flic or cancel a pending connection. 174 | * 175 | */ 176 | - (void)disconnect; 177 | 178 | @end 179 | 180 | /*! 181 | * @protocol FLICButtonDelegate 182 | * 183 | * @discussion The delegate of a FLICButton instance must adopt the FLICButtonDelegate protocol. All calls to the delegate methods will be on the main dispatch queue. 184 | * 185 | */ 186 | @protocol FLICButtonDelegate 187 | 188 | /*! 189 | * @method buttonDidConnect: 190 | * 191 | * @param button The FLICButton instance that the event originated from. 192 | * 193 | * @discussion This method is called every time the Flic establishes a new bluetooth connection. Keep in mind that you also have to wait for the buttonIsReady: before 194 | * the Flic is ready to be used. 195 | * 196 | */ 197 | - (void)buttonDidConnect:(FLICButton *)button; 198 | 199 | /*! 200 | * @method buttonIsReady: 201 | * 202 | * @param button The FLICButton instance that the event originated from. 203 | * 204 | * @discussion This method is called after each connection once the Flic has been cryptographically verified. You will not receive any click events before this is called. 205 | * 206 | */ 207 | - (void)buttonIsReady:(FLICButton *)button; 208 | 209 | /*! 210 | * @method button:didDisconnectWithError: 211 | * 212 | * @param button The FLICButton instance that the event originated from. 213 | * @param error This error lets you know the reason for the disconnect. An error does not necessarily mean that something went wrong. 214 | * 215 | * @discussion This method is called every time the bluetooth link with the Flic is lost. This can occur for several different reasons. The most common would be that 216 | * the iOS device and the Flic is no longer within range of each other. 217 | * 218 | */ 219 | - (void)button:(FLICButton *)button didDisconnectWithError:(NSError * _Nullable)error; 220 | 221 | /*! 222 | * @method button:didFailToConnectWithError: 223 | * 224 | * @param button The FLICButton instance that the event originated from. 225 | * @param error This error lets you know why the connection attempt failed. 226 | * 227 | * @discussion This method is called when a connection attempt to a button fails. This indicates that something has gone wrong and that the pending connection will not be reset. 228 | * 229 | */ 230 | - (void)button:(FLICButton *)button didFailToConnectWithError:(NSError * _Nullable)error; 231 | 232 | @optional 233 | 234 | /*! 235 | * @method button:didReceiveButtonDown:age: 236 | * 237 | * @param button The FLICButton instance that the event originated from. 238 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 239 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 240 | * 241 | * @discussion The Flic registered a button down event. 242 | * 243 | */ 244 | - (void)button:(FLICButton *)button didReceiveButtonDown:(BOOL)queued age:(NSInteger)age; 245 | 246 | /*! 247 | * @method button:didReceiveButtonUp:age: 248 | * 249 | * @param button The FLICButton instance that the event originated from. 250 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 251 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 252 | * 253 | * @discussion The Flic registered a button up event. 254 | * 255 | */ 256 | - (void)button:(FLICButton *)button didReceiveButtonUp:(BOOL)queued age:(NSInteger)age; 257 | 258 | /*! 259 | * @method button:didReceiveButtonClick:age: 260 | * 261 | * @param button The FLICButton instance that the event originated from. 262 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 263 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 264 | * 265 | * @discussion The Flic registered a button click event. 266 | * 267 | */ 268 | - (void)button:(FLICButton *)button didReceiveButtonClick:(BOOL)queued age:(NSInteger)age; 269 | 270 | /*! 271 | * @method button:didReceiveButtonDoubleClick:age: 272 | * 273 | * @param button The FLICButton instance that the event originated from. 274 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 275 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 276 | * 277 | * @discussion The Flic registered a double click event. 278 | * 279 | */ 280 | - (void)button:(FLICButton *)button didReceiveButtonDoubleClick:(BOOL)queued age:(NSInteger)age; 281 | 282 | /*! 283 | * @method button:didReceiveButtonHold:age: 284 | * 285 | * @param button The FLICButton instance that the event originated from. 286 | * @param queued Whether the event is a queued event that happened before the Flic connected or if it is a real time event. 287 | * @param age If the event was queued, then this will let you know the age of the event rounded to the nearest second. 288 | * 289 | * @discussion The Flic registered a button hold event. 290 | * 291 | */ 292 | - (void)button:(FLICButton *)button didReceiveButtonHold:(BOOL)queued age:(NSInteger)age; 293 | 294 | /*! 295 | * @method button:didUnpairWithError: 296 | * 297 | * @param button The FLICButton instance that the event originated from. 298 | * @param error This will always be nil at this time. 299 | * 300 | * @discussion The app no longer has a valid pairing with the Flic button. The isUnpaired property will now be YES and all connection 301 | * attempts made will immediately fail. To fix this you need to delete the button from the manager and then re-scan it again. 302 | * 303 | */ 304 | - (void)button:(FLICButton *)button didUnpairWithError:(NSError * _Nullable)error; 305 | 306 | /*! 307 | * @method button:didUpdateBatteryVoltage: 308 | * 309 | * @param button The FLICButton instance that the event originated from. 310 | * @param voltage Float representation of the latest battery voltage sample. 311 | * 312 | * @discussion This callback will be sent once the Flic button updates its battery voltage with a new value. Typically this will occurs a few seconds 313 | * after the button connects. If you show a battery indicator in you app, then this would be a good place to refresh your UI. Please 314 | * see the description for the batteryVoltage property for more information. 315 | * 316 | */ 317 | - (void)button:(FLICButton *)button didUpdateBatteryVoltage:(float)voltage; 318 | 319 | /*! 320 | * @method button:didUpdateNickname: 321 | * 322 | * @param button The FLICButton instance that the event originated from. 323 | * @param nickname The new nickname that was sent from the Flic. 324 | * 325 | * @discussion If the nickname is updated by another app (including the official Flic app), then you will get this callback letting you know that the 326 | * name has changed. This may either be in real time (if multiple apps are connected at the same time), or a deayed event that 327 | * occurs after the button connects (if the nickname was changed while your app was not active). If your app displays this nickname, 328 | * then this would be a good place to refresh your UI. 329 | * 330 | */ 331 | - (void)button:(FLICButton *)button didUpdateNickname:(NSString *)nickname; 332 | 333 | @end 334 | 335 | NS_ASSUME_NONNULL_END 336 | --------------------------------------------------------------------------------