Flutter (Channel stable, 2.2.0, on Mac OS X 10.15.7 19H524 darwin-x64, locale en-IN)
Android toolchain - develop for Android devices (Android SDK version 30.0.2)
Xcode - develop for iOS and macOS
-Android Studio (version 4.1)
Plugin config
To Reproduce
Steps to reproduce the behavior:
Add URL to receive the HTTP post
Monitor the HTTP post received
Debug logs
ios XCode logs, - na
Android: $ adb logcat - na
Additional context
The built-in HTTP service was unable to format the payload as per requirement and also I'm finding it difficult to convert the payload to base64
the required payload format is -----> '{ "devid": "865234030342981","time": "$formattedLastSentForDatabase","etype": "G_LOC","location": {"lat": ${location.coords.latitude},"lon": ${location.coords.longitude},"speed": ${location.coords.speed},"alt": ${location.coords.altitude}},"vbat": 3847,"pInt": 20}' .
I would also be grateful if we can send the same payload using MQTT ...
I tried implementing the MQTT fn in the "onLocation" method, but the MQTT disconnects when the app is closed or in the background. (stopOnTerminate: false, enableHeadless: true, are enabled)
Your Environment
Plugin version: 2.0.5
Platform: Android
OS version: 10
Device manufacturer / model: POCO F1
Flutter info (
flutter info
,flutter doctor
):Flutter (Channel stable, 2.2.0, on Mac OS X 10.15.7 19H524 darwin-x64, locale en-IN)
Android toolchain - develop for Android devices (Android SDK version 30.0.2)
Xcode - develop for iOS and macOS -Android Studio (version 4.1)
Plugin config
To Reproduce Steps to reproduce the behavior:
Debug logs
$ adb logcat
- naAdditional context The built-in HTTP service was unable to format the payload as per requirement and also I'm finding it difficult to convert the payload to base64
the required payload format is -----> '{ "devid": "865234030342981","time": "$formattedLastSentForDatabase","etype": "G_LOC","location": {"lat": ${location.coords.latitude},"lon": ${location.coords.longitude},"speed": ${location.coords.speed},"alt": ${location.coords.altitude}},"vbat": 3847,"pInt": 20}' .
I would also be grateful if we can send the same payload using MQTT ... I tried implementing the MQTT fn in the "onLocation" method, but the MQTT disconnects when the app is closed or in the background. (stopOnTerminate: false, enableHeadless: true, are enabled)