Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cordova-background-geolocation
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Aksimaya
cordova-background-geolocation
Commits
ea71a5b3
Commit
ea71a5b3
authored
Jul 15, 2015
by
Chris Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
1a2eea84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
README.md
README.md
+8
-1
No files found.
README.md
View file @
ea71a5b3
...
@@ -61,11 +61,18 @@ The plugin creates the object `window.BackgroundGeolocation` with the methods
...
@@ -61,11 +61,18 @@ The plugin creates the object `window.BackgroundGeolocation` with the methods
// As with all Cordova plugins, you must configure within an #deviceready callback.
// As with all Cordova plugins, you must configure within an #deviceready callback.
//
//
function onDeviceReady() {
function onDeviceReady() {
// Get a reference to the plugin.
var bgGeo = window.BackgroundGeolocation;
/**
/**
* This callback will be executed every time a geolocation is recorded in the background.
* This callback will be executed every time a geolocation is recorded in the background.
*/
*/
var callbackFn = function(location, taskId) {
var callbackFn = function(location, taskId) {
console.log('[js] BackgroundGeoLocation callback: ' + location.latitude + ',' + location.longitude);
var coords = location.coords;
var lat = coords.latitude;
var lng = coords.longitude;
console.log('[js] BackgroundGeoLocation callback: ' + JSON.stringify(location));
/**
/**
* This would be your own callback for Ajax-requests after POSTing background geolocation to your server.
* This would be your own callback for Ajax-requests after POSTing background geolocation to your server.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment