FlutterGeofencing
FlutterGeofencing copied to clipboard
iOS: allowsBackgroundLocationUpdates should be optional
I'm using this great plugin for geofencing in my app. Geofencing is the only location service that is used in the background by my app, no location updates or similiar things.
The app got rejected by Apple because it included the background location mode as a capability without using any background location features.
Since the plugin sets allowsBackgroundLocationUpdates
to true, the app crashes right away when you don't include the background mode.
Removing the background mode and not setting allowsBackgroundLocationUpdates
actually works with region monitoring and even launches the app in the background after being swiped off.
Apple's documentation is very misleading and lacking in that regard (like usual) in my opinion, I was quite surprised by that and thought the background mode was obvious for this usecase.
To prevent apps from being rejected, allowsBackgroundLocationUpdates
should probably be controlled by a parameter in the GeofencingManager.initialize()
method.
Ah, that's a good point, didn't realize that was an issue. I can add this eventually, but if you'd like to submit a pull request I'd be happy to review / accept it :-).