The iOS version of AromaShooterController SDK which is used to communicate with Aroma Shooter devices.
- Aroma Shooter Bluetooth version
- iOS version: >= 8.0
- Swift version: >= 3.0
- Download the framework file at the release page.
- Drag and drop it into your project. (Make sure that it is added in Embedded Binaries section in your project's target page).
Watch a video walkthrough of this process to simplify your life.
From iOS 13 and later, it is required to add the Bluetooth usage description, if not the app will be crashed.
So, please add the key and its value to the app's Info.plist
file.
<key>NSBluetoothAlwaysUsageDescription</key>
<string>The app uses Bluetooth to connect to Aroma Shooter</string>
Besides, if you get the "Target Integrity" in XCode 12.3, please check out the solution here.
- Import Controller module
import AromaShooterControllerSwift
- Get the Controller class reference
var controller = AromaShooterController.sharedInstance
We have done the connection UI part for you. You can easily open the connection view controller by one of two ways.
if you are using NavigationController
, please use these codes.
let connectionVC = controller.getConnectionViewController()
if let connectionVC = connectionVC {
self.navigationController?.pushViewController(connectionVC, animated: true)
}
In other cases, you can use the below codes.
let connectionVC = controller.getConnectionViewController()
if let connectionVC = connectionVC {
self.present(connectionVC, animated: true, completion: nil)
}
let connectedDevices = controller.connectedDevices
- Diffuse scents of all connected devices
controller.diffuseAll(duration: 3000, booster: true, ports: [1, 2, 3])
- Diffuse scents of specific devices
controller.diffuse(aromaShooters: devices, duration: 3000, booster: true, port: [1, 2, 3])
- Diffuse scents method for AS2 (AromaShooter 2) devices only
controller.diffuseAll(durationInMilli: 1000, boosterIntensity: 0, fanIntensity: 50, ports: [CartridgePort(number: 3, intensityPercent: 100)])
controller.diffuse(aromaShooters: controller.connectedDevices, durationInMilli: 1000, boosterIntensity: 50, fanIntensity: 40, ports: [CartridgePort(number: 3, intensityPercent: 100)])
Stop all ports of current connected devices if they have been diffusing
controller.stopAll();
For more information, please checkout this repository and refer to the sample project.
If you get any issues or require any new features, please create a new issue.
Please check the LICENSE file for the details.