Jasonette / JASONETTE-Android

📡 Native App over HTTP, on Android
https://www.jasonette.com
Other
1.6k stars 270 forks source link

Web Container to have location access #258

Open shierro opened 5 years ago

shierro commented 5 years ago

Hi, i have a single page web app, that i want to load in a web container. So far, it loads it well.

Now, some of the page needs to access location data, but for some reason the webview doesn't ask me to allow/block the location access, and rejects it immediately.

i have added some permissions but still doesn't seem to work

    <uses-permission android:name="android.permission.ACCESS_GPS" />
    <uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Might be related to this but i'm not sure how or where to inject the android code

Can anyone give me some leads on how to do this properly? Will appreciate any feedback and thanks in advance!

clsource commented 5 years ago

Normally you could use and agent https://jasonelle.com/jasonette-old-docs/agents/ to fetch the location using the native apis and then inject the result in your webview.

SRosales0520 commented 3 years ago

I, along with another friend, are having the exact same issue and it is really frustrating. we think we've narrowed it down to a function called "onRequestPermissionsResult" in the app>src>main>com.jasonette.seed>Core>JasonViewActivity.java file. it seems like it has a line of code in the if statement for camera but nothing for location/gps. we don't know if this is the source of the issue for sure or what lines to add after the cameraManager one.

clsource commented 3 years ago

https://github.com/jasonelle/jasonette-android/pull/19 maybe that pr helps