HaylLtd / cordova-background-geolocation-plugin

Background and foreground geolocation plugin for Cordova.
Apache License 2.0
57 stars 66 forks source link

HTTP Templates values cannot be set to NULL #168

Open fabiandepaula opened 1 year ago

fabiandepaula commented 1 year ago

Describe the bug If you assign to any of the properties of the TEMPLATE configuration you are going to have a CONFIGURATION error when you put your application in background or when you return from it.

To Reproduce Steps to reproduce the behavior:

  1. Set a property, any, generate a new one and assign it NULL
  2. Start the service
  3. Put your APP in background
  4. See error

Expected behavior Was a really sorprise, i didnt expect to that happened. It is very useful to start a property with a null value.

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

HarelM commented 1 year ago

Some code would have helped... Feel free to add input validation check in a PR if you would like this solved, sounds to me like something you would do accidentally, then test, and understand that it's wrong, but that might just be me :-)

fabiandepaula commented 1 year ago

It is real!! What else would I like to be able to contribute to the project. But really my knowledge of JAVA is very basic and I really don't know what I should do to make the BUG I present disappear. I'll really try to see what can be done, but I think the person who made the plugin should be able to solve it without any problem and in a matter of seconds. Greetings!!!!

El jue, 9 nov 2023 a la(s) 08:26, Harel M @.***) escribió:

Some code would have helped... Feel free to add input validation check in a PR if you would like this solved, sounds to me like something you would do accidentally, then test, and understand that it's wrong, but that might just be me :-)

— Reply to this email directly, view it on GitHub https://github.com/HaylLtd/cordova-background-geolocation-plugin/issues/168#issuecomment-1803652485, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGQTCQT4OUA2EFHZ2PBEUDYDS4W3AVCNFSM6AAAAAA7CJKT5KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBTGY2TENBYGU . You are receiving this because you authored the thread.Message ID: <HaylLtd/cordova-background-geolocation-plugin/issues/168/1803652485@ github.com>

HarelM commented 1 year ago

I don't know what the use case is as you have not shared any code. Regardless, you can use android studio to be able to reproduce the issue if it happens always and see which code changes need to be done in order to fix this. Once you find a way to solve the issue feel free to open a PR. If you need assistance in setting up a debug environment, I suggest reading the cordova/ionic manuals.

goparklubanic commented 10 months ago

I have little different case. Our back end can not fetch the posted data. Here the configuration we used:

        url: 'https://ourbackend.com/api/set',
        syncUrl: 'https://ourbackend.com/api/set',
        httpHeaders:{
            'Content-type':'application/json',
        },
        postTemplate:{
            lat: '@latitude',
            lon: '@longitude',
            dev: device.uuid,
        }

So, @HarelM , would you please tell us the equivalent or similar syntax of the configuration above in javascript fetch or curl format? When we send the data using fetch in separate function , our back end which run laravel could retrieve the posted data.

HarelM commented 10 months ago

I can't help here, sorry, you'll need to figure it out yourself.

goparklubanic commented 10 months ago

It's OK. My curiosity led me to sniff packets sent from this plugin to local unsecured servers. Here are the results. Hopefully it can help anyone who will create a back end server. cbgl-data-sniff