NetTalk Central

Author Topic: p_web.GetLocation() in a chrome explorere in android device  (Read 4598 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
p_web.GetLocation() in a chrome explorere in android device
« 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
« Last Edit: October 30, 2020, 07:31:26 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: p_web.GetLocation() in a chrome explorere in android device
« Reply #1 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

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: p_web.GetLocation() in a chrome explorere in android device
« Reply #2 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
-----------
Regards
Alberto

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: p_web.GetLocation() in a chrome explorere in android device
« Reply #3 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

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: p_web.GetLocation() in a chrome explorere in android device
« Reply #4 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: p_web.GetLocation() in a chrome explorere in android device
« Reply #5 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