Interview frequency: …
Short answer
Request permission in context when the feature is used, explain the reason to the user first, add the required descriptions to Info.plist and AndroidManifest.xml, and handle permanent denials.
Explanation
Apple and Google reject apps that request permissions such as camera or location immediately at startup without a clear reason. First show a screen explaining the feature's benefit. After repeated denials, programmatically direct the user to system settings through Linking.openSettings().
Code example
import { Camera } from 'expo-camera';
import { Linking, Alert } from 'react-native';
async function requestCameraPermission() {
const { status, canAskAgain } = await Camera.requestCameraPermissionsAsync();
if (status !== 'granted') {
if (!canAskAgain) {
Alert.alert(''Permission required', 'Please enable camera permission in your phone settings to continue', [
{ text: 'Open settings', onPress: () => Linking.openSettings() }
]);
}
}
}Common mistakes
- Forgetting required explanatory text (such as NSCameraUsageDescription in Info.plist), which causes the app to crash immediately on iOS when requesting permission.