maplibre / maplibre-navigation-ios

MapLibre Navigation SDK for iOS
Other
29 stars 27 forks source link

Only require background audio when using speech synthesis #64

Closed michaelkirk closed 2 weeks ago

michaelkirk commented 2 weeks ago

Fixes #63

I'm not currently using voice instructions. I'd like to add it at some point, but my app is still useful without this feature.

The SDK requires the background "Audio" entitlement at runtime, but without the voice instructions, there's no reason for the background "Audio" entitlement.

The AppStore may not accept an application with the background audio entitlement that doesn't actually use background audio. (speaking from experience here 😬)

RouteVoiceController.verifyBackgroundAudio is called upon init, which happens when instantiating a NavigationViewController. Instead we should wait until we actually use the audio before verifying this permission.

michaelkirk commented 2 weeks ago

Rebased.

This has been approved for a few days and is pretty small, so I'm going to merge. LMK if there's a different process I should follow in the future.