Get user location using geolocation isn’t working on fb internal browser

  facebook-messenger, geolocation, javascript

I have a website, where user location(lat/lng) can be retrieved with single click using navigator.geolocation.getCurrentPosition. This works fine in all major browser like chrome, firefox etc. However, if the link is forwarded to fb messenger & browsed using internal browser & click on the same button. It doesn’t work.

I also check the ready made code of Mozilla on fb messenger.

Link: https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API

Go to result section for demo.

Source: Ask Javascript Questions

LEAVE A COMMENT