androidjs icon indicating copy to clipboard operation
androidjs copied to clipboard

app.location is undefined

Open KCGD opened this issue 4 years ago • 2 comments
trafficstars

Describe the bug I'm trying to use the location API by calling app.location.get() (i included all the proper permissions), but it returns undefined. i tried inspecting the app object with vconsole and its missing the location property.

Expected behavior I expected the location property to be part of the app and for app.location.get to return either the device's coordinates or an error

Screenshots image

Desktop (please complete the following information):

  • OS: windows 10
  • Browser: chrome 92.0.4515.131
  • Version: androidjs 2.2.4 (using SDK 2.2.0)

Smartphone (please complete the following information):

  • Device: Razer Phone 2
  • OS: Android 9
  • Browser Chrome/stock
  • Version same as above androidjs

Additional context app.location is also undefined when testing the app in my desktop's browser

KCGD avatar Aug 06 '21 05:08 KCGD

I have the same issue. app.location is undefined.

package.json

"permission": [
        "android.permission.INTERNET",
        "android.permission.ACCESS_FINE_LOCATION",
        "android.permission.ACCESS_COARSE_LOCATION",
        "android.permission.ACCESS_BACKGROUND_LOCATION"
    ],

navigator.geolocation also errors. navigator.geolocation.watchPosition returns the PERMISSION_DENIED error code (1).

The terminal shows quite a number of service manager errors (shown below). These may or may not be related, but they are definitely related to the app I'm working on.

ServiceManager: Permission failure: android.permission.HIGH_SAMPLING_RATE_SENSORS from uid=xxxxx pid=21025

I checked the app permissions in the Android settings and the Location permission is allowed all the time, the precise location toggle is checked, and the remove permissions and free up space toggle is not checked.

Is there a way to get location permissions to work?

ajbogh avatar Nov 29 '21 09:11 ajbogh

Hey @KCGD @ajbogh, can you both make sure that you are using the latest version of Android JS?

Chhekur avatar Feb 15 '22 15:02 Chhekur