A
A
akubenov2017-01-23 09:15:35
satellite navigation
akubenov, 2017-01-23 09:15:35

Is it possible to determine if GPS is enabled on a smartphone from a mobile browser?

Is it possible to determine if GPS is enabled on a smartphone using js from a mobile browser?
Thank you in advance :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
EVG, 2017-01-23
@f_ban

I have not seen a direct API that provides such functionality.
I use this trick. The navigator.geolocation.getCurrentPosition() method takes an error handler as the second parameter. If any error other than PERMISSION_DENIED got into the handler, then I inform the user that geolocation is not available, please check if the geolocation module is enabled.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question