mauron85/cordova-plugin-background-geolocation

activityType config doesn't work on iOS due to string cmp bug in MAURConfig.m

Closed this issue · 2 comments

I have also reported this bug on the sub-project for the iOS code. I report it here too as it's pretty critical and can cause a lot of headache, did for me. You can get road snapping when you don't want to for example, ie Fitness activity type becomes AutomotiveNavigation.

String comparisons in MAURConfig.m look like this now:
if ([activityType caseInsensitiveCompare:@"AutomotiveNavigation"]) {
return CLActivityTypeAutomotiveNavigation;
}

but that actually means "if string NOT matches". It should instead be

if ([activityType caseInsensitiveCompare:@"AutomotiveNavigation"] == NSOrderedSame) {
return CLActivityTypeAutomotiveNavigation;
}

stale commented

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.

stale commented

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.