Open Settings App from another App in iOS - React Native

后端 未结 9 1312
予麋鹿
予麋鹿 2020-12-29 02:40

I\'m going through the docs in React Native and can only find navigating to external links from the app I am in.

I want to be able to navigate to the Settings

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 03:18

    I successfully opened the settings by the code below, hope it's helpful :)

    Linking.canOpenURL('app-settings:').then(supported => {
      if (!supported) {
        console.log('Can\'t handle settings url');
      } else {
        return Linking.openURL('app-settings:');
      }
    }).catch(err => console.error('An error occurred', err));
    

    Reference: https://facebook.github.io/react-native//docs/linking.html

提交回复
热议问题