Boky
Boky

Reputation: 12084

How to link to phone settings from react native app

I'm creating an react-native app and I want to show and warning to user if their IOS version is < 11.0.

That works fine. I have something as follows:

enter image description here

What I want is to go the phone settings if they click on Go to settings.

The code for that is as follows:

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));

Thus I try to do it with Linking.openURL('app-settings:'). But the problem is that that goes to the settings of my app, but I want to go to the settings index page or even better to system upgrade setting.

I need it only for IOS.

Any idea how can I do that?

Upvotes: 3

Views: 2489

Answers (1)

mag_zbc
mag_zbc

Reputation: 6992

You can no longer do that. You could use the URL App-Prefs:, which does what you want, but that will cause your app to be rejected upon review, because it's considered non-public URL scheme.

The only URL allowed by Apple is the constant UIApplicationOpenSettingsURLString, which takes you to your app's setting, not general settings of the device.

Upvotes: 5

Related Questions