iOS background location update closed when app closed
- Platform: iOS
- OS version: 10.3
- Device manufacturer and model:
- React Native version: react-native-cli: 2.0.1 react-native: 0.47.2
############# Config ###############
desiredaccuracy: 10,
stationaryRadius: 50,
distanceFilter: 50,
locationTimeout: 30,
notificationTitle: 'Smart Track',
notificationText: 'Live Tracking Enabled',
debug: true,
startOnBoot: true,
stopOnTerminate: false,
saveBatteryOnBackground: false,
activityType: 'OtherNavigation',
interval: 10000,
url: "https://www.testapps.com/ws/api/clCmAddTrack",
syncUrl: "https://www.testapps.com/ws/api/clCmAddTrack",
httpHeaders: {
'Accept': 'application/json',
}
});
BackgroundGeolocation.on('location', (location) => {console.log(location)} );
BackgroundGeolocation.on('stationary',(location) => {console.log('Stationary',location)} );
BackgroundGeolocation.on('error', (error) => {
log(' BackgroundGeolocation error:', error);
});
BackgroundGeolocation.start(() => {
log('[BackgroundGeolocation started successfully');
callback();
});
####################################################
Expected Behavior
After app close it should retrieve location and push it to url.
Actual Behavior
When app running in foreground or background location pushing happening properly. Once app is closed location retrieval not happening. Gps icon hidden after 5 seconds of app closed.
When running on debug mode and app in background got some push notification "## Outstanding bg-task was force-killed"
Warning: this issue has been inactive for 54 days and will be automatically closed on 2017-11-22 if there is no further activity.
@sharavana006 update on it ?
Now it's working normally even after app close. Not sure what happened
@sharavana006 also working for me on IOS. will test on Android.
@sharavana006 @mauron85 @Furqankhanzada @sharavana06 @morrislaptop I think you solved the background tracking issue. I am facing the issue in background location tracking problem in android and iOS Here are my issues: iOS:
-
when i lock the device the background geolocation is not working. there in background i am calling some api calls. When i unlock the after 15 mints all the api calls are called at a time. But it should not happen like that
-
I want to call the all the apis in background only. i.e Even when the device is lock also.
Android:
- In Android when the the app is open all are working fine but when the app closed, i wrote a code like setInterval inside the BackgroundGeolocation.on('background',
- In iOS this function working fine but in android this not working when the app is in background, Is there any functionality need to change for android to this module.
Below is my code, Can you please check my code and give me some suggestions, Any suggestion must be helpful.
Here is the code: https://www.dropbox.com/s/gax5hfkyps5qu9q/demo.js?dl=0
Currently if you terminate app, location tracking is not possible on iOS. It's one of milestones for future.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@mauron85 Is stopOnTerminate working in iOS as DOC said right now ?
How to Call Background geolocation when app is closed. in foreground it works fine. But not work when app killed/close please help me !
it doesn't working when app is Terminated on IOS
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed, because it has not had recent activity. If you believe this issue shouldn't be closed, please reopen or write down a comment requesting issue reopening with explanation why you think it's important. Thank you for your contributions.