transistorsoft / flutter_background_fetch

Periodic callbacks in the background for both IOS and Android. Includes Android Headless mechanism
MIT License
571 stars 167 forks source link

[BUG] Unable to encode payload for HTTP to base64. #224

Closed deekshithx closed 3 years ago

deekshithx commented 3 years ago

Your Environment

To Reproduce Steps to reproduce the behavior:

  1. Add URL to receive the HTTP post
  2. Monitor the HTTP post received

Debug logs

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)

christocracy commented 3 years ago

flutter_background_fetch has nothing to do with HTTP requests.

christocracy commented 3 years ago

Are you posting this at the wrong Github repo?