mauron85 / react-native-background-geolocation-example

Example app of react-native-mauron85-background-geolocation component.
120 stars 45 forks source link

BackgroundGelocation error:undefined #2

Open shaikhussian opened 7 years ago

shaikhussian commented 7 years ago

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

img_0020

mauron85 commented 7 years ago

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

shaikhussian commented 7 years ago

@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

mauron85 commented 7 years ago

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.

shaikhussian commented 7 years ago

@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 commented 6 years ago

@mauron85 please respond

shafiqshams commented 5 years ago

@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.