just so you folks know that I'm persistent - and try to solve my own problems... here's the code that's running to try to start the plugin that Appery brought in.....:
var bgeoon = false;
function fBackgroundGeoCall(location) {
console.log('[js] BackgroundGeoLocation callback: ' + location.latitude + ',' + location.longitude);
localStorage.setItem('s_lat', location.latitude);
localStorage.setItem('s_long', location.longitude);
// insert code here to determine if in current boundar....
var nlat = Number(location.latitude);
var nlong = Number(location.longitude);
var options = {
lat: nlat,
lng: nlong
};
var ocurrentposition = new google.maps.LatLng(nlat, nlong);
console.log('the current position object is:' + ocurrentposition);
}
function fStartGeo() {
//
//
// after deviceready
//
//
//alert('In fwatchmyposition- startup');
var BackgroundGeo;
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 60000
};
try {
console.log('i made it to here......');
BackgroundGeo = window.BackgroundGeoLocation;
console.log('1');
if (BackgroundGeo === undefined && window.plugins !== undefined) {
console.log('trying undefined 1');
BackgroundGeo = window.plugins.BackgroundGeoLocation;
}
console.log('2');
Code: Select all
if (BackgroundGeo === undefined && plugins !== undefined) {
console.log('trying undefined 2');
BackgroundGeo = plugins.BackgroundGeoLocation;
}
console.log('3');
if (BackgroundGeo === undefined) {
console.log('trying undefined 3');
BackgroundGeo = window.bgGeo;
}
console.log('4');
// if (BackgroundGeo === undefined) {
// console.log('trying undefined 4-a');
// BackgroundGeo = bgGeo;
// console.log('was there a syntax error here');
// }
console.log('5');
if (BackgroundGeo === undefined && window.plugins !== undefined) {
console.log('trying undefined 5');
BackgroundGeo = window.plugins.bgGeo;
}
console.log('6');
if (BackgroundGeo === undefined && plugins !== undefined) {
console.log('trying undefined 6');
BackgroundGeo = plugins.bgGeo;
}
console.log('7');
if (BackgroundGeo === undefined) {
console.log('trying undefined 7');
BackgroundGeo = window.BackgroundGeolocation;
}
console.log('8');
// if (BackgroundGeo === undefined) {
// console.log('trying undefined 8');
// BackgroundGeo = BackgroundGeolocation;
// }
console.log('9');
if (BackgroundGeo === undefined && window.plugins !== undefined) {
console.log('trying undefined 9');
BackgroundGeo = window.plugins.BackgroundGeolocation;
}
console.log('10');
if (BackgroundGeo === undefined && plugins !== undefined) {
console.log('trying undefined 10');
BackgroundGeo = plugins.BackgroundGeolocation;
}
console.log('11');
if ( BackgroundGeo === undefined ) {
BackgroundGeo = window.background-geolocation ; }
console.log('what the heck');
console.log('12');
} catch (e) {
console.log(e);
}
Code: Select all
if (BackgroundGeo !== undefined) {
var callbackFn = fBackgroundGeoCall; //function(location) {
var failureFn = function(error) {
console.log('BackgroundGeoLocation error');
};
// alert('Configuring Geolocation');
// BackgroundGeoLocation is highly configurable.
try {
BackgroundGeo.configure(callbackFn, failureFn, {
desiredAccuracy: 10,
stationaryRadius: 20,
distanceFilter: 100,
notificationTitle: 'Background tracking', //
Please help...