Basic Features
Start proximity service
To start Proximity, call:
The startService
method accept a list of integers that represent the venues id where you want to start the proximity service. After service is started, a callback will be returned.
Background Mode
The proximity service start must be called when application is in foreground mode.
Stop proximity
When you want to stop proximity service, call:
Observe for interaction trigger event
It's possible to observe when an interaction has been fired by the Proximity SDK. Visit Interaction to know more about interaction object.
val state: Flow<NextomeSdkState> = nextomeSdk.getStateObservable()
yourScope.launch {
NextomeProximitySdk.instance.getInteractionsObservables()?.collect {
// The interaction is fired by the SDK. Do something.
var interaction: NextomeInteraction = it
}
}
Observeble into a scope
To avoid concurrency problem, getInteractionsObservables
method need to live inside a coroutine scope.
Observeble at application start
Is strongly recommanded to call this method at Application.onCreate method as shown at Getting Started section to be sure that a Enter/Exit region event can be correctly dispatched by operative system to the application.
Get observed venues
It's possible get a list of venues id where proximity service is on. That's is hopeful when you open the application again after service has been started. This method allow you to know which venues, so which interactions, the application is listening for.
© 2024 Nextome srl | All Rights Reserved.