24

I want to open ios setting app from my app. the settings destination is [ settings => notification => myapp ]. to turn on & turn off push notification.

There are some documents about how to link to settings, but I don't know how to open deep link. (notification => myapp).

How can I do this?

ton1
  • 7,238
  • 18
  • 71
  • 126

7 Answers7

37

You can deep-link referencing the settings's index like so:

Linking.openURL('app-settings:')

Above method only for IOS

Arunkumar
  • 1,705
  • 1
  • 17
  • 25
34

Since React Native 0.60 to open App settings use:


import { Linking } from 'react-native';

Linking.openSettings();

Open the app’s custom settings, if it has any.

Works for Android and iOS

Docs link: https://reactnative.dev/docs/linking#opensettings

B. Mohammad
  • 2,152
  • 1
  • 13
  • 28
5

Use Linking.openURL. For example, below is how to check and open Health app on iOS

import { Linking } from 'react-native'

async goToSettings() {
  const healthAppUrl = 'x-apple-health://'
  const canOpenHealthApp = await Linking.canOpenURL(healthAppUrl)
  if (canOpenHealthApp) {
    Linking.openURL(healthAppUrl)
  } else {
    Linking.openURL('app-settings:')
  }
}
onmyway133
  • 45,645
  • 31
  • 257
  • 263
5

for iOS 14, this is how i open location service settings

Linking.openURL('App-Prefs:Privacy&path=LOCATION')

tested in react native 0.63.4

Abid Khairy
  • 1,198
  • 11
  • 9
2

To access specific settings screens, try this: Linking.openURL("App-Prefs:root=WIFI"); Linking to app-settings only opens the settings for the Reference: iOS Launching Settings -> Restrictions URL Scheme (note that prefs changed to App-Prefs in iOS 6)

Julian K
  • 1,877
  • 2
  • 19
  • 27
1

Try this one for Open Specific System URL - Linking.openURL('App-Prefs:{3}')

-1

try this

Linking.openURL('app-settings://notification/myapp')
Govan
  • 1,322
  • 1
  • 14
  • 13