cordova-plugin-location-provider
Version:
This Android background service provides the location of the device via HTTP-POST e.g. triggered by GCM notification.
67 lines (54 loc) • 2.17 kB
Markdown
This [Cordova][cordova] plugin implements __Android__ background service for location queries triggered by e.g. GCM notification. The plugin is also compatible with [PhoneGap Build][PGB].
- __Android__
```javascript
cordova.plugins.LocationProvider.setConfiguration(/*JSONObject*/ config);
```
```javascript
cordova.plugins.LocationProvider.getAndClearHistory(successCallback);
function successCallback(/*JSONObject*/ history){
// process the history
}
```
The plugin can either be installed from git repository, from local file system through the [Command-line Interface][CLI] or cloud based through [PhoneGap Build][PGB].
From master:
```bash
cordova plugin add https://github.com/ToniKorin/cordova-plugin-location-provider.git
```
from a local folder:
```bash
cordova plugin add cordova-plugin-location-provider --searchpath path
```
or to use the latest stable version:
```bash
cordova plugin add cordova-plugin-location-provider@1.4.8
```
To remove the plug-in, run the following command:
```bash
cordova plugin rm cordova-plugin-location-provider
```
Add the following xml line to your config.xml:
```xml
<gap:plugin platform="android" name="cordova-plugin-location-provider" version="1.4.8" source="npm"/>
```
Check the [Change Log][changelog].
This software is released under the [Apache 2.0 License][apache2_license].
© 2016 Toni Korin
[]: https://cordova.apache.org
[]: http://cordova.apache.org/docs/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface
[]: http://docs.build.phonegap.com/en_US/index.html
[]: https://build.phonegap.com/plugins/490
[]: https://github.com/ToniKorin/cordova-plugin-location-provider/blob/master/CHANGELOG.md
[]: http://opensource.org/licenses/Apache-2.0