Software Archive
Read-only legacy content
17061 Discussions

NEED HELP with cordova-plugin-navis-background-geolocation


Hello All!

I stopped with problem working with cordova-plugin-navis-background-geolocation .

I can build project for Android, but when I try init this object  window.plugin.backgroundGeoLocation I get undefined.

when I try search how to resolve problem , found only this two similar sites:


It's hard to me correctly reflect to XDK specific .



There need only one simple task:

after get app.ready

document.addEventListener("app.Ready", first_locate, false);


function first_locate(){
    if (navigator.geolocation) {
      alert('Init ok');    
    }, function() {
      alert('Error ');     
      //handleLocationError(true, infoWindow, map.getCenter());
    {enableHighAccuracy: true});
  } else {
    // Browser doesn't support Geolocation
     alert('Dont support ');   
    //handleLocationError(false, infoWindow, map.getCenter());
  //var bgGeo = window.plugin.backgroundGeoLocation;
  var bgGeo = window.plugins.backgroundLocationServices;      

   if (typeof bgGeo === 'undefined') {
               alert('Plugin has not been initialized properly!', 'Error');
               //return false;
   if (window.plugin.backgroundGeoLocation) {
    if (window.plugin.backgroundLocationServices) {


get any alert message , or don't get 

Plugin has not been initialized properly! 

message .


Any help are welcome!

Very need .....


All needed version for Android-sdk are OK

XDK 3522

Java SDK 1.08.101

all plugins from npm latest versions

framework F7


0 Kudos
2 Replies

I'm guessing you're trying to use this plugin inside of the Simulate tab or in App Preview. It will only work in the Debug tab or in a built app.

Also, looking at the README and the sample app in that plugin repo it appears that the API interface is different. See the code in this sample > < and notice that references are via an object named "backgroundGeoLocation" which would be inside window, not navigator.

I am speculating, I do not know that plugin and am guessing based on a very quick scan, you should take a closer look at the documentation and examples provided by the plugin developer.

0 Kudos

Thank's for replay.

But: I build app to apk file and get alert that object not init properly.

Ok,  I'll test one more time for BackgroundGeoLocation object  ( there is so much forked plugin's :)  )


May I sound one wishes?

Background plugins for geolocations and for background task are very needed in common programming tasks - may Your team test and provide two plugins (geo and for tasks) as core plugins for XDK with testing and well know behaviour ?

For geolocation background may use this navis plugin (He builds fine w/o errors and works in Android and iOS)






0 Kudos