react-native-background-geolocation-example icon indicating copy to clipboard operation
react-native-background-geolocation-example copied to clipboard

BackgroundGelocation error:undefined

Open shaikhussian opened this issue 8 years ago • 6 comments

when i run this example i am getting an error like this please help me, How to resolve this.

img_0020

shaikhussian avatar Nov 13 '17 12:11 shaikhussian

If you have been using previous version, I recommend you to remove project and clone again.

I've just tested on clean repo, it's working fine

mauron85 avatar Nov 13 '17 14:11 mauron85

@mauron85 i want to send my location to my db for that i wrote like this ` BackgroundGeolocation.on('location', (location) => { console.log("location123:"+JSON.stringify(location)) BackgroundGeolocation.startTask(taskKey => { console.log("taskKey123:"+taskKey) //Here I am calling my api post service for passing the location to db

    // execute long running task
    // eg. ajax post location
    // IMPORTANT: task has to be ended by endTask
    //BackgroundGeolocation.endTask(taskKey);
  });
});

`

i have questions that is this function call every time or only once

i want to track my location when app is in background also every time

can please help me and give some suggestions please

shaikhussian avatar Nov 14 '17 06:11 shaikhussian

Basically you have to wrap your code withing startTask and endTask as shown in example. And you have to do it for every location you received. So yes, you have to call them everytime.

mauron85 avatar Nov 14 '17 08:11 mauron85

@mauron85 i need to call every time or automatically it will call when location changed? and i am getting some notifications from plugin i don't want those notifications how can i stop those

shaikhussian avatar Nov 15 '17 05:11 shaikhussian

@mauron85 please respond

shaikhussian avatar Nov 16 '17 03:11 shaikhussian

@shaikhussian did you find any solution? I am having the same problem. Even I turned off the debug to false but still getting these beep noises.

shafiqshams avatar Jan 29 '19 14:01 shafiqshams