Hello dears
I have 3 beacons , how can I expand the Notification Demo to send different notifications based on the beacon’s identifier ?
if you have an example code , share it with me plz !
thank you
Hello dears
I have 3 beacons , how can I expand the Notification Demo to send different notifications based on the beacon’s identifier ?
if you have an example code , share it with me plz !
thank you
Hello, you must register the cloud estimote the app attachment in yours beacons.
for example I use proximity beacons and this is the code:
val zone = ProximityZoneBuilder()
.forTag(“appId”)
.inNearRange()
.onEnter {val title: String = it.attachments[“appId/title”] ?: “unknown”
val helloNotification = buildNotification(getproximityTitle(title), getproximityTextEntrada(title))
notificationManager.notify(notificationId,helloNotification )}
And getProximityTitle(String) and getproximityextEntrada(String) are funtions that I create for change the title and text for this notification.
fun getproximityTitle(beacon:String):String {
val proximityContentAdapter = ProximityContentAdapter(context)
val titulo = proximityContentAdapter.getTitleNotification(beacon)
return titulo
}
fun getTitleNotification(beacon:String): String {
val lista: List = listOf(“Math”, “Biblio”,“Economicas”,“Derecho”,“Filosofía”,“Ciencias”,“No se encuentra el beacon”)
return when (beacon) {
"ice" ->lista.get(0)
"coconut" -> lista.get(1)
"candy" -> lista.get(2)
"mint" -> lista.get(3)
"blueberry" -> lista.get(4)
"lemon" -> lista.get(5)
else -> lista.get(6)
}
}