How to open an Android intent in react native using Linking.openURL(). For example how to open WIFI settings menu of Android.
can you use some like as
async function goToSettings(ios: string = 'WIFI', android: string = 'WIFI_SETTINGS') {
if (Platform.OS === 'ios') {
// https://medium.com/@contact.jmeyers/complete-list-of-ios-url-schemes-for-apple-settings-always-updated-20871139d72f
await Linking.openURL(`prefs:root=${ios}`);
}
// https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/provider/Settings.java
await Linking.sendIntent(`android.settings.${android}`);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With