Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove allowsBackgroundLocationUpdates from iOS LocationManager #326

Merged
merged 1 commit into from
Dec 23, 2017
Merged

Remove allowsBackgroundLocationUpdates from iOS LocationManager #326

merged 1 commit into from
Dec 23, 2017

Conversation

mjwwit
Copy link
Contributor

@mjwwit mjwwit commented Nov 7, 2017

This PR removes the LocationManager.allowsBackgroundLocationUpdates for the iOS plugin code.

The code was causing issues (#212, #233) when being used with WKWebView (not sure why). The suggested fix, enabling background location updates capability, fixed the runtime error but would result in Apple rejecting the app. According to Apple the background location updates capability is not required for background beacon monitoring.

Background monitoring still works as long as the Location Always permission is granted. I tested this on iOS 11.0.3. The app was in a killed state (swiped from the recent apps, XCode confirmed app was not running) when testing.

The PR also updates the FAQ to remove the old suggested fix.

@petermetz
Copy link
Owner

Hi @mjwwit

Thanks a lot for the PR, I'll merge this in, because everybody should be upgrading to WKWebView anyway, but have a side question to clarify:
Does this mean that with UIWebView the old code is the working code, and for WKWebView the new code is the working code? If yes, I'll have to make a note of this breakage in the FAQ/README to make sure people know what's going on after a plugin upgrade.

Peter

@mjwwit
Copy link
Contributor Author

mjwwit commented Dec 23, 2017

Hi Peter, thanks for merging! I haven't tested how this impacts UIWebView. However, Apple made it very clear that the background location is not needed if you're monitoring beacons.

I really don't know why apps don't crash on LocationManager.allowsBackgroundLocationUpdates when using UIWebView and having the capability turned off. Maybe this is a bug in iOS?

@petermetz
Copy link
Owner

Hi @mjwwit Honestly, I can only guess as well.

that the background location is not needed if you're monitoring beacons

I think when they say that they mean the newer versions of iOS. I remember that somewhere around iOS 8 or 9 this was the only way to get the apps to wake up from a killed state in response to entering/existing a region.

Is this discussion you had with them available on a public channel where I could go and ask about the older versions?

@mjwwit
Copy link
Contributor Author

mjwwit commented Dec 27, 2017

Sadly not, this conversation took place in iTunes Connect because our app was rejected. It may be valuable to start a public conversation about this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants