android通用深层链接说明需要您上传.well-known/assetlinks.json进行验证。Expo 深度链接文档指示您按照官方 Android 文档格式化文件,但该文档假设您正在使用 android studio 来构建您的应用程序。 https://developer.android.com/training/app-links/verify-site-associations
\n\nsha256_cert_fingerprints:您的应用\xe2\x80\x99s\n签名证书的 SHA256 指纹。您可以使用以下命令通过 Java keytool 生成\n指纹: keytool -list -v -keystore\nmy-release-key.keystore
\n
该文档还不清楚 namespace需要什么值。
我们将本机 Android 应用程序转换为 React 本机应用程序,并为新应用程序使用了 expo 管理的工作流程。对于深度链接,我们使用了博览会的链接文档,一切正常。但最近我们注意到,对于某些用户(特别是三星设备),Android 应用程序对所有 URL(对于配置的域)开放。
意图过滤器设置:
{
"expo": {
"android": {
"intentFilters": [
{
"action": "VIEW",
"data": [
{
"scheme": "https",
"host": "*.domain.com",
"pathPrefix": "/jobs"
},
{
"scheme": "https",
"host": "*.domain.com",
"pathPrefix": "/can/recommended-jobs"
},
{
"scheme": "https",
"host": "*.domain.com",
"pathPrefix": "/can/cv-views"
},
{
"scheme": "https",
"host": "*.domain.com",
"pathPrefix": "/can/conversations"
},
{
"scheme": "https",
"host": "*.domain.com",
"pathPrefix": "/can/profile/basic-info"
},
{
"scheme": "https",
"host": "*.domain.com",
"pathPattern": "/.*/jobs/.*-.*"
},
{
"scheme": "https",
"host": "*.domain.com",
"pathPrefix": "/mobile/can/profile"
}, …Run Code Online (Sandbox Code Playgroud) android react-native expo react-native-deep-linking expo-linking
React Native包expo-linking有一个名为 的钩子,useURL当应用程序在后台运行时,该钩子对我不起作用。从文档来看,Returns the initial URL followed by any subsequent changes to the URL.我的托管博览会应用程序遇到的问题是,当应用程序已在后台打开时,挂钩不起作用。这是钩子:
export default function App() {
const isLoadingComplete = useCachedResources();
const url = Linking.useURL();
useEffect(() => {
Alert.alert(url ? url.substring(20) : 'null');
}, [url]);
if (!isLoadingComplete) {
return null;
} else {
return (
...
);
}
}
Run Code Online (Sandbox Code Playgroud)
exp://exp.host/@myprofile/myproject?a=b如果我在应用程序关闭时打开 URL ,我会按预期收到警报。如果应用程序在后台运行,则警报不会响起。我已经在 iOS 模拟器和物理 Android 上进行了测试。有什么解决办法吗?请注意,类似的问题也发生在Linking.addEventListener().