Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open Setting using expo with Linking.openURL('app-settings')

Hello I tried to follow a tutorial on youtube on how to make the app open the location settings if the user has not enabled location services. However on his computer it is working ( he is using android emulator though) me with my Iphone XS (which I believe works on latest IOS version) does not do anything.

I've tried to open just setting or even a link on internet but it does not work

openSetting = () => {
    if(Platform.OS=='ios'){
      Linking.openURL('app-settings:')
    }
    else{
      IntentLauncherAndroid.startActivityAsync(
        IntentLauncherAndroid.ACTION_LOCATION_SOURCE_SETTINGS
      );
    }
    this.setState({openSetting:false});

  }
<Button onPress={() => this.setState({isLocationModalVisible:false, openSetting:true})}
          title ="Enable Location Services"/>
like image 391
El Pandario Avatar asked Jul 29 '26 22:07

El Pandario


1 Answers

This is how it will work in Expo SDK 45.0:

Linking.openSettings()
like image 160
Abhishek Jain Avatar answered Jul 31 '26 20:07

Abhishek Jain