PolyOS API Overview
PolyOS API exposes the API between PolyOS and 3rd party applications.
This API can be called from either DeviceType.PRIMARY
or DeviceType.CONTROLLER
device.
Setup
//Create PolyOsManager, the entry point to PolyOS API
polyOsManager = PolyOsManager(context)
//Notify PolyOS when app state changes
polyOsManager.notifyAppStateChanged(AppState(inCall = true))
//Access PolyOS methods through helper suspend function
val isMuted = polyOsManager { audioService.isMicrophoneMuted }
//Mute microphone
polyOsManager { audioService.muteMicrophone(true)}
//Use runWhenConnected to perform any initialization or registration each time when PolyOsManager is connected
polyOsManager.runWhenConnected {
//Register for audio notifications
audioService.registerAudioListener(audioListener)
//Register for messages
roomService.registerRoomListener(roomListener)
}
Getting PolyOS API
repositories {
maven {
url 'http://public.polyrepo.com/artifactory/poly-local/'
allowInsecureProtocol = true
}
}
dependencies {
implementation 'com.poly.polyos:polyos-library:#VERSION'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1"
}
License
Packages
Package | Description |
---|---|
com.poly.polyos | PolyOsManager is the entry point to PolyOS API. |
com.poly.polyos.analytics | Exposes Analytics data |
com.poly.polyos.audio | Audio related API |
com.poly.polyos.camera | Camera related API |
com.poly.polyos.room | Exposes API to communicate between companion pair apps running in the Room Primary device and Controller devices. |
com.poly.polyos.settings | Configuration settings related API |
com.poly.polyos.system | System related API |