使用离子和电容器创建的Deeplink不起作用



AndroidManifest.xml

<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:name="io.ionic.starter.MainActivity" android:label="@string/title_activity_main" android:theme="@style/AppTheme.NoActionBarLaunch" android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:label="DeepLink" android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="fundcore-testapp.azurewebsites.net" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="fundcore-testapp.azurewebsites.net" />
</intent-filter>
</activity>
<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
</provider>
</application>
<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />

assetlinks.json

[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target" : { "namespace": "android_app", "package_name": "com.beyond.app",
"sha256_cert_fingerprints": ["my key"] }
}]

我已经将assetlinks.json部署到https网站。我在codepen上创建了一个指向页面(即https网站(的锚标记。当我在手机上打开代码笔并点击锚标签时,它不会打开我的应用

我检查了你的链接https://fundcore-testapp.azurewebsites.net/.well-known/assetlinks.json返回的信息是正确的,我会排除配置问题,也正如在评论中发生的那样,删除无用的意图,让它单独使用

<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="fundcore-testapp.azurewebsites.net" />
</intent-filter>

此外,为了帮助您,如果您发布与电容器相关的代码,如果您使用Angular,请注意文档中描述的"@Angular/core"中NgZone的使用https://capacitorjs.com/docs/guides/deep-links以管理接收到的url。尽管很明显也要检查你的";applicationId";在build.gradle文件中,该文件与assetlinks.json中指定的文件相匹配,并根据您使用的将@connector/app更新为最新版本

最新更新