Here working unified example:
import { Linking } from 'expo';
import * as Application from 'expo-application';
import * as IntentLauncher from 'expo-intent-launcher';
const open_settings = () => {
// TODO: it might work on SDK 37?
// Linking.openSettings();
if (Platform.OS === 'ios') {
Linking.openURL(`app-settings:`);
} else {
const bundleIdentifier = Application.applicationId;
IntentLauncher.startActivityAsync(IntentLauncher.ACTION_APPLICATION_DETAILS_SETTINGS, {
data: `package:${bundleIdentifier}`,
});
}
}
has @notbrent say, you must render open_settings button when the following conditon:
import { Platform } from 'react-native';
(Platform.OS === 'android' && Platform.Version >= 26) || Platform.OS === 'ios';