Monaca Localkit getCurrentPosition Doesn't Seem to Work

  • I have upgraded Monaca Localkit to 2.1.3.

    During Monaca Localkit Preview, when I call the
    navigator.geolocation.getCurrentPosition(successFunc, errorFunc, geoOptions)
    function, I always get the following error.

    "Network location provider at ’’ : Returned error code 400

    It used to work in the previous Monaca Localkit version (I forgot the version #) and it works when I run the code with a regular browser such as Chrome.
    (I am running the code not on a phone but on my desktop Mac)
    I thought perhaps I need to specify a Google API Key which I have tried but still get an error.

    Is there an issue with Monaca Localkit using geolocation?
    Is there a work around??


  • @baystar47 Take a look at:

    The good thing is, we know the request is working and something is just malformed in our request due to the error code. This would mean it is not a Monaca issue and is a coding issue. Since it used to work, I would assume it would come down to a config issue in the app now - meaning, that once compiled, something isn’t being carried over where we think it should be going. If I remember correctly, Monaca changed the Android config files recently. Hopefully, this is a starting point. Does the error code return in details about the 400 code?

  • Monaca

    I don’t think it’s an issue related to Localkit itself as we don’t include anything that can interfere with the location. If you think it’s version related, I suggest you to try to download an older version of localkit and test it again. Here is the link

Log in to reply