-
Notifications
You must be signed in to change notification settings - Fork 407
Closed
HaylLtd/cordova-background-geolocation-plugin
#20Labels
staleauto labeled abandoned issues after a period of inactivityauto labeled abandoned issues after a period of inactivity
Description
Your Environment
- Plugin version:3.0.3
- Platform: iOS
- OS version:12.1
- Device manufacturer and model: iPhone 6s plus
- Running in Simulator: Yes
- Cordova version (
cordova -v): 9.0.0 - Cordova platform version (
cordova platform ls):5.0.0 - Plugin configuration options:
- Link to your project:
Context
this.platform.ready().then(() => {
this.init();
});
// init bg-geo
init() {
const config: BackgroundGeolocationConfig = {
desiredAccuracy: 10,
stationaryRadius: 1,
distanceFilter: 1,
maxLocations: 10,
debug: true,
stopOnTerminate: false
};
this.backgroundGeolocation.configure(config)
.then(() => {
this.backgroundGeolocation.on(BackgroundGeolocationEvents.location).subscribe((location) => {
this.logger.info(location);
});
});
this.backgroundGeolocation.start();
}
Expected Behavior
App runs normally, running location monitoring
Actual Behavior
After init background-geolocation,this is run 'start()'. App crash.
2019-04-01 10:16:32.585834+0800 TimeStory[6768:1623947] CDVBackgroundGeolocation #start
2019-04-01 10:16:32.586395+0800 TimeStory[6768:1624020] BgGeo #start: 0
2019-04-01 10:16:32:586 TimeStory[6768:1624018] BgGeo #start: 0
2019-04-01 10:16:32:589 TimeStory[6768:1623947] DistanceFilterLocationProvider iOS9 detected
2019-04-01 10:16:32.604441+0800 TimeStory[6768:1624020] DistanceFilterLocationProvider will start
2019-04-01 10:16:32:589 TimeStory[6768:1623947] DistanceFilterLocationProvider will start
2019-04-01 10:16:32.612263+0800 TimeStory[6768:1623947] CDVBackgroundGeolocation #onAuthorizationChanged
2019-04-01 10:16:32.612993+0800 TimeStory[6768:1624020] DistanceFilterLocationProvider switchMode 1
2019-04-01 10:16:32:592 TimeStory[6768:1623947] DistanceFilterLocationProvider switchMode 1
2019-04-01 10:16:32.630591+0800 TimeStory[6768:1624021] LocationManager didChangeAuthorizationStatus 4
2019-04-01 10:16:32:609 TimeStory[6768:1623947] LocationManager didChangeAuthorizationStatus 4
warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.
Possible Fix
Recursive callbacks occur here, and the comments run correctly.
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
willPresentNotification:(UNNotification *)notification
withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
if (prevNotificationDelegate && [prevNotificationDelegate respondsToSelector:@selector(userNotificationCenter:willPresentNotification:withCompletionHandler:)])
{
// Give other delegates (like FCM) the chance to process this notification
// [prevNotificationDelegate userNotificationCenter:center willPresentNotification:notification withCompletionHandler:^(UNNotificationPresentationOptions options) {
// completionHandler(UNNotificationPresentationOptionAlert);
// }];
}
else
{
completionHandler(UNNotificationPresentationOptionAlert);
}
}
Steps to Reproduce
Context
Debug logs
Metadata
Metadata
Assignees
Labels
staleauto labeled abandoned issues after a period of inactivityauto labeled abandoned issues after a period of inactivity