aromajoin / controller-sdk-ios Goto Github PK
View Code? Open in Web Editor NEWEnable developers to connect and control Aroma Shooter.
Home Page: https://aromajoin.com/software/sdk
License: Apache License 2.0
Enable developers to connect and control Aroma Shooter.
Home Page: https://aromajoin.com/software/sdk
License: Apache License 2.0
โ (../../packages/aromajoin_controller/ios/Controller.swift:1:8)
1 | import AromaShooterControllerSwift
| ^ module compiled with Swift 5.2.4 cannot be imported by the Swift 5.8.1 compiler: /Users/suhao/github/smell/apps/expo/node_modules/aromajoin_controller/AromaShooterControllerSwift.framework/Modules/AromaShooterControllerSwift.swiftmodule/arm64.swiftmodule
Hi everyone,
Because there are many cases that we connect an Aroma Shooter automatically to reduce one step for users.
I would like to propose a solution like the following in which the app will automatically scan the devices nearby and connect to your intended Aroma Shooter using its serial number.
import Foundation
import UIKit
import AromaShooterControllerSwift
class ViewController: UIViewController {
let asController = AromaShooterController.sharedInstance
public var connectedDevices: [AromaShooter] = []// Just to comfort iOS Bluetooth auto-disconnection if there is no reference
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
scanAndAutoConnect()
}
private func scanAndAutoConnect() {
asController.startScanning()
asController.delegate = self
}
}
extension ViewController: AromaShooterDelegate {
func aromaShooter(didDiscoverDevice device: AromaShooter) {
// Check if this discovered device has the same serial that you want to connect
// For example: the serial number is ASN2A00001
if device.peripheral.name == "ASN2A00001" {
asController.connect(aromaShooters: [device])
connectedDevices.append(device)
asController.stopScanning()
}
}
func aromaShooter(didConnectDevice device: AromaShooter) {
}
func aromaShooter(didDisconnectDevice device: AromaShooter) {
}
}
if you get any issue with this or have a better solution, please give a comment in this thread.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.