问题
I am building an app for Android and ios with phonegap that includes a compass. Therefore I am using the w3c api as explained in this article
My problem is that the use of the compass is critical in my application so I need to make the user aware that his phone's compass has a problem whenever it is poorly calibrated.
I know for a fact that you can check the compass accuracy with native code in Java for Android. I don't know anything about Swift and ios.
My question is : Would you know any easy way to get the information about the compass accuracy with phonegap ? I've been searching a plugin to do that but I couldn't find anything really (except maybe for Android this plugin )
Thank you very much in advance
回答1:
Since it seems there were no possible answers to that question. I created the solution :
https://github.com/simsComputing/cordova-plugin-headingcalibration
This is my first cordova plugin so it surely is not perfect. It isn't published on npm yet. When I find time to complete it and publish it, i'll do it. In the mean time if anyone finds this thread, feel free to use the plugin.
来源:https://stackoverflow.com/questions/56158455/is-there-an-easy-way-to-get-phones-compass-heading-accuracy-in-phonegap