NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto on October 30, 2020, 07:25:04 AM

Title: p_web.GetLocation() in a chrome explorere in android device
Post by: Alberto on October 30, 2020, 07:25:04 AM
Hi, Im using     p_web.GetLocation() and it works ok in a PC web browser but when I try it in my android phone it does not work.
Im always getting a blanck latitud and longitude
Permissions in android for google is ok.
but Im getting:

GET /SetSessionValue?_LocationError_=1_permission_denied&_ajax_=1

Any hint?
Thanks
Title: Re: p_web.GetLocation() in a chrome explorere in android device
Post by: Bruce on November 01, 2020, 11:28:21 PM
Permission Denied means that the permission is, um, well, denied.
Perhaps because the site is not HTTPS? Or because the user did not allow the location to be shared.

cheers
Bruce
Title: Re: p_web.GetLocation() in a chrome explorere in android device
Post by: Alberto on November 02, 2020, 05:38:34 AM
jeje, OK

Yes its not https, but it works ok on chome localhost and do not on chrome android
Title: Re: p_web.GetLocation() in a chrome explorere in android device
Post by: Jane on November 02, 2020, 07:32:35 PM
Chrome makes some security exceptions for locahost.
That's why it works on your machine where you're accessing localhost.
And doesn't on your android that isn't accessing localhost.

https://chromium.googlesource.com/chromium/src/+/master/docs/security/faq.md#Which-origins-are-secure

one option:
https://developers.google.com/web/tools/chrome-devtools/remote-debugging/local-server

or install a recognized certificate on your local server and switch to https.

Jane
Title: Re: p_web.GetLocation() in a chrome explorere in android device
Post by: osquiabro on November 27, 2020, 06:15:43 AM
I have a problem with p_web.GetLocation (), I don't know which version of NT broke my code in the past? My site https://fecipur.org/LoginForm was working, my code is in a Procedure Setup and try in different procedure but don't work

p_web.GetLocation ()
GLO: Latitude = CLIP (p_web.GetSessionValue ('_ Latitude_'))
p_web.SetSessionValue ('GLO: Latitude', GLO: Latitude)
GLO: Length = CLIP (p_web.GetSessionValue ('_ Length_'))
p_web.SetSessionValue ('GLO: Length', GLO: Length)

values are returned but not displayed in a form, my site is secure.

what is the correct procedure for this?

NT 11.43
Title: Re: p_web.GetLocation() in a chrome explorere in android device
Post by: Bruce on November 30, 2020, 09:49:14 PM
p_web.GetLocation is asynchronous - the results are not returned immediately.

Also your use of GLO is suggestive of global variables, which you should not be using.

Cheers
Bruce