Linking with android os settings in react native

ε祈祈猫儿з 提交于 2019-11-28 10:04:20

Linking.openURL can only open correctly formatted urls. There are no standardized urls for the android settings. You would have to write some native code to do this, and then build a React Native Module to trigger it.

Here is some example Android code:

public void openWifiSettings() {
    Intent intent = new Intent(Intent.ACTION_WIFI_SETTINGS);
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!