I do have the Location Sensor enabled (see screenshot), and still my app cannot detect location. The location permission dialogue doesn’t even pop up. It works great on web, and even mobile browsers on the same phone on which my Thunkable app is installed.
My app is 100% a webviewer app, built with PHP, so I didn’t use any Thunkable blocks in building it.
Geolocation is allowed on this android phone I’m testing with, which is why when I load the app (it’s a web application built with Laravel) in my mobile browser, geolocation works fine.
But upon your suggestion, I’m going to install the app on a different android phone. I’ll let you know in a few minutes how it goes. Please stand by.
In the meantime, I went to upload my apk into Google’s Console for an internal test track. They scanned my apk and if you look at this warning, you can clearly tell that LOCATION is not listed in the required permissions.
I’m positive that this means my downloaded Thunkable apk does not include location in the permissions list, even though I included Thunkable’s Location Sensor in my app. See screenshot.
No, that is not what I did. I UPLOADED my Thunkable apk into Google, so that my testing group could download that private release for internal testing purposes. Part of that process is Google scanning the APK to see what permissions it requires.
I was just pointing out that LOCATION should have been listed in that little report from Google, but it wasn’t. Could that be one of the reasons why I’m struggling with location?
PS: I tried your example in the app and got exactly the same results as before. Uploading to Google is just something else that I was trying out when I noticed that location was not listed, meaning the Thunkable APK is NOT including location services at all.
When I tested your code, I only took the javascript portion of your example (not the blocks), and pasted into my web app where geolocation is required. Just as before, it works great (gets the location) when viewed in a browser (even mobile browser on my phone), BUT NOT IN MY THUNKABLE WEBVIEWER APP.
I have updated my example and ask you to run my example in your Live on your Android device and tell me if it works or not. The geolocation data will disappear in about 2 seconds and you need to wait after clicking the button.