React Native Open settings through Linking.openURL in IOS

前端 未结 6 2180
失恋的感觉
失恋的感觉 2021-02-05 20:32

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 so

相关标签:
6条回答
  • 2021-02-05 20:39

    Since React Native 0.60 to open App settings use:

    Linking.openSettings()

    0 讨论(0)
  • 2021-02-05 20:44

    try this

    Linking.openURL('app-settings://notification/myapp')
    
    0 讨论(0)
  • 2021-02-05 20:47

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

    Linking.openURL('app-settings:')
    

    Above method only for IOS

    0 讨论(0)
  • 2021-02-05 20:48

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

    0 讨论(0)
  • 2021-02-05 20:52

    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:')
      }
    }
    
    0 讨论(0)
  • 2021-02-05 20:52

    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)

    0 讨论(0)
提交回复
热议问题