100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Bug fix for Android geofence
Rich Turner8473cb9989c9
diff --git a/console/android/src/main/java/org/openremote/android/service/GeofenceTransitionsIntentService.kt b/console/android/src/main/java/org/openremote/android/service/GeofenceTransitionsIntentService.ktindex 7ec809cb9..c306d648f 100644--- a/console/android/src/main/java/org/openremote/android/service/GeofenceTransitionsIntentService.kt+++ b/console/android/src/main/java/org/openremote/android/service/GeofenceTransitionsIntentService.kt@@ -39,15 +39,16 @@ class GeofenceTransitionsIntentService : IntentService("or-geofence") {connection.setRequestProperty("Content-Type", "application/json")connection.requestMethod = "POST"connection.connectTimeout = 10000+ connection.doInput = falseif (geofenceTransition == Geofence.GEOFENCE_TRANSITION_ENTER) {- val postJson = {- "objectValue" to {- "type" to "Point"+ val postJson = hashMapOf(+ "objectValue" to hashMapOf(+ "type" to "Point","coordinates" to arrayOf(geofencingEvent.triggeringLocation.longitude, geofencingEvent.triggeringLocation.latitude)- }- }+ )+ )connection.doOutput = trueconnection.setChunkedStreamingMode(0)@@ -57,8 +58,11 @@ class GeofenceTransitionsIntentService : IntentService("or-geofence") {try {connection.outputStream.flush()+ val responseCode = connection.responseCode} catch (exception: Exception) {print(exception)+ } finally {+ connection.outputStream.close()}}}\ No newline at end of file