最近将我们的构建目标切换到 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)