Start up and run IOS crash
See original GitHub issueYour 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
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Fix iPhone App Crashing on Startup: on iPad, After iOS 16.2 ...
Fix iPhone App crashing on Startup: on iPad, After iOS 16.2 Update · Restart or reboot iPhone, iPad or Hard Reset · Up-to-date...
Read more >App crashing immediately on start up after upgrading to iOS12.
Running fine in simulator but crashes in device. No crash logs recorded. In line error shown after launching the app Thread 1: EXC_BAD_ACCESS...
Read more >iOS development app startup crash - iphone - Stack Overflow
Shift-command-K (clean). Double check the dev account is hooked up right. Delete and reinstall the app on the device. Make sure the device...
Read more >Crash on startup with XCode 14 / iOS 16 · Issue #10705 - GitHub
1), running an app in the iOS simulator will result in an instant crash, directly after the splash screen is shown. I first...
Read more >No, I Swear My iOS App Doesn't Crash on Startup!
No, I Swear My iOS App Doesn't Crash on Startup! A simple lesson I learned as an enterprise architect about indie iOS game...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This same issue happened to me.
I solved installing the plugin
cordova-plugin-local-notification
.On iOS Devices a notification is triggered when the location is updated. It seems you need to have a way to show it or the app will crash.
hello everyone, That issue is still alive on IOS and needs to be fixed asap as i just recently implemented background-geolocation and what i noticed is i am still having that app crashing issue on debug=true