phonegap: how to check if gps is enabled

前端 未结 3 1200
耶瑟儿~
耶瑟儿~ 2021-02-06 09:01

I want to show an alert saying that \"Please turn on your GPS\".

How can I get GPS status using phonegap?

I have used following code but I don\'t get any alert m

3条回答
  •  灰色年华
    2021-02-06 09:21

    The best way to check if GPS, Wifi, … is enabled, is to use this plugin:

    https://www.npmjs.com/package/cordova.plugins.diagnostic

    Using this plugin you can check a lot of features and you can switch the user to the settings.

提交回复
热议问题