从iOS中的另一个应用程序打开设置应用程序 - React Native [英] Open Settings App from another App in iOS - React Native
问题描述
我正在浏览React Native中的文档只能从我所在的应用程序中找到导航到外部链接。
I'm going through the docs in React Native and can only find navigating to external links from the app I am in.
我希望能够导航到设置
app(更具体地说是隐私>位置服务页面)但是,似乎无法找到它的必要信息。有这样的原生iOS 方式,我试图通过React Native复制。
I want to be able to navigate to the Settings
app (more specifically to the privacy > location services page) but, can not seem to find the necessary information on it. There is the native iOS way of doing it which I am trying to replicate through React Native.
这可能吗?
我尝试过以下方法来检测是否存在设置网址。控制台记录设置网址
然而,它不会导航到该页面。
I have tried the following to detect if there is a Settings URL. The console logs that the Settings url works
however, it does not navigate to that page.
更新:感谢@zvona我现在正在导航到设置页面,但不知道如何进入特定的深层链接。
Update: thanks to @zvona I am now navigating to the settings page but not sure how to get to a specific deep link.
Linking.canOpenURL('app-settings:').then(supported => {
console.log(`Settings url works`)
Linking.openURL('app-settings:'
}).catch(error => {
console.log(`An error has occured: ${error}`)
})
推荐答案
您可以访问应用程序的设置:
Linking.openURL(' app-settings:');
You can access settings of the application with:
Linking.openURL('app-settings:');
但我还不知道如何打开特定的深层链接。
But I don't know (yet) how to open a specific deep-link.
这篇关于从iOS中的另一个应用程序打开设置应用程序 - React Native的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!