小编Bef*_*ire的帖子

在 React Native 上定位 android 30 sdk 时,Linking.canOpenURL 返回 false

最近将我们的构建目标切换到 android 30 以添加对 Android 11 的支持,现在方向和电话呼叫不起作用。

该文档提到了本机深度链接和/或 npm 包的使用。这会在本地完成吗?或者这个包是一种选择?

https://reactnative.dev/docs/linking

Linking.canOpenURL 现在在运行 android 30 时检查它是否受支持时返回 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."));
Run Code Online (Sandbox Code Playgroud)

linker android native reactjs react-native

5
推荐指数
3
解决办法
1502
查看次数

标签 统计

android ×1

linker ×1

native ×1

react-native ×1

reactjs ×1