问题
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?
回答1:
You can deep-link referencing the settings's index like so:
Linking.openURL('app-settings:')
Above method only for IOS
回答2:
Since React Native 0.60 to open App settings use:
Linking.openSettings()
回答3:
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:')
}
}
回答4:
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)
回答5:
Try this one for Open Specific System URL - Linking.openURL('App-Prefs:{3}')
回答6:
try this
Linking.openURL('app-settings://notification/myapp')
来源:https://stackoverflow.com/questions/44582694/react-native-open-settings-through-linking-openurl-in-ios