how to get current location in phonegap?

后端 未结 2 1837
走了就别回头了
走了就别回头了 2021-01-14 09:10

i added Geolocation plugin in my app and used this code for getting the current location in phonegap. but this code does not work.

    document.addEventList         


        
2条回答
  •  甜味超标
    2021-01-14 09:26

    On iOS this will always work one way or the other. If the plugin fails, the browser's own Geolocation API will be used. There's some undesired side effects with the fallback though:

    • The permission dialog that pop's up has the html file's name in the title instead of the app name
    • Granted permissions will only persist as long as the app is running

    On Android it only works if you have set the correct permissions in app/AndroidManifest.xml:

    
    
    
    

提交回复
热议问题