【发布时间】:2021-02-18 07:29:53
【问题描述】:
最近将我们的构建目标切换到 android 30 以添加对 Android 11 的支持,现在方向和电话呼叫不起作用。
文档中提到了本机深度链接和/或使用 npm 包。 这会在本地完成吗?还是包是一个选项?
https://reactnative.dev/docs/linking
在运行 android 30 时检查是否支持 Linking.canOpenURL 现在返回 false。
Linking.canOpenURL(url)
.then((supported: boolean) => (supported ? Linking.openURL(url) : Alert.alert("Error", "There was an error attempting to opening the location.")))
.catch(() => Alert.alert("Error", "There was an error attempting to opening the location."));
【问题讨论】:
-
你能给我们你要打开的网址吗?
-
这解决了吗?我什至无法在 android 11 上打开
https://www.google.com
标签: android reactjs react-native linker native