XAPP Audio can be interactive through the use of the device’s microphone, thus record permission needs to be granted by the user.
iOS and early Android take two different approaches for the user to grant access to the microphone. With the release of Android M (API >= 23), the approaches are consolidated.
- System permission dialog is consistant across all permissions
- Can only be asked once
- Limited opportunity for customization
- App can still function without all permissions granted
Android (API < 23)
- All the permissions are granted at the time of download/update
- If permissions are not granted, access to the app is not granted
- Easier for development
- Less user friendly and more restrictive
Android (API >= 23)
- iOS style permissions
- System permission dialog can be asked more than once until the user checks "Never Ask Again"
- System permission cannot be customized
- New permissions only go into effect when building with API level 23 and above
How to Ask for Record Permission?
## Ask in Context
If you already have a feature in your app that requires the use of the device’s microphone to function, wait until the user attempts to use the feature to ask for permission. If your app has a feature that allows your users to upload audio for a chance to be played live on-air, simply request the permission when the user attempts to access the feature. By attempting to access the feature that requires the microphone, the user is not surprised when the record permission is requested, understands what it is needed for and is more likely to grant permission.
For permissions that are critical to the app functioning or don’t have a clear entry point into the feature, it is best to ask for the permission when the user first installs or updates the app. This is typically done through user onboarding, which thoughtfully explains the app to a new user and educates them why they need certain permissions before they are asked.
Unlike asking in context, it is unknown if the user is ready to grant record permission during the onboarding. Since the system permission can only be asked once, it is a best practice to gauge how the user will respond by a pre-permission dialog that explains the need and if they would like to grant permission. This provides better context for the permission and also conserves the system permission dialog if they aren’t ready.
Pre-permission dialogs can take many forms but the primary goal is to gauge how the user will respond to the system permission before presenting it. On iOS the system permission can only be asked once and on Android the user can prevent it from being asked more than twice thus presenting it should be conserved for when the user is ready to grant the permission.
The Permissions API, provided with the SDK, provides an easy way to request for permissions from the user, leveraging pre-permission dialogs to explain to the why the permission is needed. A pre-permission strategy can be monitored real-time and updated remotely to help improve the messaging for a better user experience.
[iOS Human Interface Guidelines Accessing User Data](https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LocationServices.html#//apple_ref/doc/uid/TP40006556-CH42-SW1)
- iOS framework for pre-permissions dialogs courtesy of Cluster
- From Cluster