android-js / androidjs

Platform to build android app using node js
MIT License
466 stars 109 forks source link

why navigator.geolocation.getCurrentPosition doesn't work ? #228

Closed pedefe closed 2 years ago

pedefe commented 2 years ago

Hello,

I tried to use app.location.get(), but app.location is "undefined".

So I try to go around with navigator.geolocation.getCurrentPosition(...) but I have the problem that "I don't share my position" (error code returned) It is not true, because I have added all the following rights in package.json:

    "permission": [
        "android.permission.ACCESS_FINE_LOCATION",
        "android.permission.ACCESS_COARSE_LOCATION",
        "android.permission.ACCESS_BACKGROUND_LOCATION",
        "android.permission.ACCESS_LOCATION_EXTRA_COMMANDS",
        "android.permission.ACCESS_MEDIA_LOCATION",
        "android.permission.LOCATION_HARDWARE",

So, none of the both solutions are working.

Any idea ?

Best regards.

Chhekur commented 2 years ago

Hey @pedefe, can you please make sure that you're using the latest version of Android JS?

pedefe commented 2 years ago

Hello Chhekur, I use

And I think that autorisations are set because I see that : image FRENCH:"Votre position" = ENGLISH"Your position"

Best regards.

pedefe commented 2 years ago

Hello,

Now it seems to work after a new npm install. Perharps the problem has been solved after I move a first time outdoor. Best regards.