To run the example project, clone the repo, and run pod install
from the Example directory first.
Library to detect smart speaker devices on local network.
Library is using mDNS lookup to find Google Home devices on the local network. Since Google Home uses Cast SDK, detection should be reliable. Amazon Alexa support is coming up soon.
Create an instance of SmartSpeakerDetector
and call detectGoogleHome
on it. This function takes a closure of type Bool -> Void
which return true
or false
based on search result.
let detector = SmartSpeakerDetector()
detector.detectGoogleHome { success in
if success {
// do something
} else {
// do something else
}
}
SmartSpeakerDetector
also provides logger functionally for debugging though the SmartSpeakerDetectorLogger
protocol which sends all detection progress events. In the example project you may tap bug button in the top right corner to check the current detection status.
class MyClass: SmartSpeakerDetectorLogger {
let detector = SmartSpeakerDetector()
init() {
detector.logger = self
}
func log(event: String) {
print(event)
}
}
iOS 10.0 or later
Simply add the following line to your Podfile:
pod 'SmartSpeakerDetector'
Add the following to your project's Cartfile:
github "cbpowell/MarqueeLabel"
SmartSpeakerDetector is available under the Apache license. See the LICENSE file for more info.