gpt4 book ai didi

javascript - 无法使用带有 Linking.openURL ('app-settings' 的 expo 打开设置)

转载 作者:行者123 更新时间:2023-12-05 05:11:12 25 4
gpt4 key购买 nike

您好,我尝试按照 youtube 上的教程进行操作,了解如何在用户未启用位置服务的情况下让应用程序打开位置设置。但是在他的电脑上它正在工作(虽然他正在使用 android 模拟器)我和我的 Iphone XS(我相信它适用于最新的 IOS 版本)没有做任何事情。

我试过只打开设置甚至互联网上的链接,但它不起作用

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"/>

最佳答案

这就是它在 Expo SDK 45.0 中的工作方式:

Linking.openSettings()

关于javascript - 无法使用带有 Linking.openURL ('app-settings' 的 expo 打开设置),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55663306/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com