我正在尝试与android os settings
页面链接。
使用Phone Dail
进入Linking
是可行的。
Linking.openURL('tel: +959 XXXXXXXX');
我可以使用
Linking
链接到android os settings
页面之类的android location settings
页面吗?
最佳答案
Linking.openURL
只能打开格式正确的网址。没有针对android settings的标准网址。您必须编写一些 native 代码来执行此操作,然后构建一个React Native Module来触发它。
这是一些示例Android代码:
public void openWifiSettings() {
Intent intent = new Intent(Intent.ACTION_WIFI_SETTINGS);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}
关于react-native - 在React Native中与Android OS设置链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38893684/