Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cordova-plugin-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-plugin-background-geolocation
Commits
d0eb9815
Commit
d0eb9815
authored
Sep 27, 2013
by
Chris Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Match cordova define with id from config.xml
parent
027c2300
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
42 deletions
+41
-42
BackgroundGeoLocation.js
www/ios/BackgroundGeoLocation.js
+41
-42
No files found.
www/ios/BackgroundGeoLocation.js
View file @
d0eb9815
...
...
@@ -21,49 +21,48 @@
* under the License.
*
*/
cordova
.
define
(
"
org.transistorsoft.cordova.BackgroundGeolocation
"
,
function
(
require
,
exports
,
module
)
{
var
exec
=
require
(
'
cordova/exec
'
);
/**
* Provides access to the vibration mechanism on the device.
*/
var
exec
=
require
(
'
cordova/exec
'
);
/**
* Provides access to the vibration mechanism on the device.
*/
module
.
exports
=
{
/**
* Configure the native API with our authentication-token and url to POST locations to
* TODO Native plugin assumes the json-structure as required by our rails server
* options:
* auth_token: authentication token
* url: endpoint that we post the locations to, including hostname
*/
configure
:
function
(
success
,
fail
,
options
)
{
success
=
(
typeof
(
success
)
===
'
function
'
)
?
success
:
function
()
{};
fail
=
(
typeof
(
fail
)
===
'
function
'
)
?
fail
:
function
()
{};
if
(
!
options
.
auth_token
||
!
options
.
url
)
{
var
msg
=
"
BackgroundGeoLocation requires an auth_token and url to report to the server
"
;
console
.
log
(
msg
);
fail
(
msg
);
return
;
}
return
Cordova
.
exec
(
success
,
fail
,
"
BackgroundGeoLocation
"
,
"
configure
"
,
[
options
.
auth_token
,
options
.
url
]);
},
/**
* Enable background GeoLocation
*/
start
:
function
(
success
,
fail
,
options
)
{
options
=
options
||
{};
success
=
(
typeof
(
success
)
===
'
function
'
)
?
success
:
function
()
{};
fail
=
(
typeof
(
fail
)
===
'
function
'
)
?
fail
:
function
()
{};
return
Cordova
.
exec
(
success
,
fail
,
"
BackgroundGeoLocation
"
,
"
start
"
,
[
options
]);
},
/**
* disable background GeoLocation
*/
stop
:
function
(
success
,
fail
,
options
)
{
options
=
options
||
{};
success
=
(
typeof
(
success
)
===
'
function
'
)
?
success
:
function
()
{};
fail
=
(
typeof
(
fail
)
===
'
function
'
)
?
fail
:
function
()
{};
return
Cordova
.
exec
(
success
,
fail
,
"
BackgroundGeoLocation
"
,
"
stop
"
,
[
options
]);
module
.
exports
=
{
/**
* Configure the native API with our authentication-token and url to POST locations to
* TODO Native plugin assumes the json-structure as required by our rails server
* options:
* auth_token: authentication token
* url: endpoint that we post the locations to, including hostname
*/
configure
:
function
(
success
,
fail
,
options
)
{
success
=
(
typeof
(
success
)
===
'
function
'
)
?
success
:
function
()
{};
fail
=
(
typeof
(
fail
)
===
'
function
'
)
?
fail
:
function
()
{};
if
(
!
options
.
auth_token
||
!
options
.
url
)
{
var
msg
=
"
BackgroundGeoLocation requires an auth_token and url to report to the server
"
;
console
.
log
(
msg
);
fail
(
msg
);
return
;
}
return
Cordova
.
exec
(
success
,
fail
,
"
BackgroundGeoLocation
"
,
"
configure
"
,
[
options
.
auth_token
,
options
.
url
]);
},
/**
* Enable background GeoLocation
*/
start
:
function
(
success
,
fail
,
options
)
{
options
=
options
||
{};
success
=
(
typeof
(
success
)
===
'
function
'
)
?
success
:
function
()
{};
fail
=
(
typeof
(
fail
)
===
'
function
'
)
?
fail
:
function
()
{};
return
Cordova
.
exec
(
success
,
fail
,
"
BackgroundGeoLocation
"
,
"
start
"
,
[
options
]);
},
/**
* disable background GeoLocation
*/
stop
:
function
(
success
,
fail
,
options
)
{
options
=
options
||
{};
success
=
(
typeof
(
success
)
===
'
function
'
)
?
success
:
function
()
{};
fail
=
(
typeof
(
fail
)
===
'
function
'
)
?
fail
:
function
()
{};
return
Cordova
.
exec
(
success
,
fail
,
"
BackgroundGeoLocation
"
,
"
stop
"
,
[
options
]);
}
}
)
;
};
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