有没有会 android 的大佬,给我整晕了 我配置了 AppLinks 一开始在我自己的服务器部署的,跳转一切正常。换到公司的(内网)发现跳转失败,当我再换回我的测试的发现我自己的也跳转不了了。一点链接就 浏览器 nginx 404 页面。不能跳到 APP 上。App Links Assistant 上验证工具也能通过,但就是没法跳转到 APP 。Android API 26 ( Android 8 ) 开发测试机 Pixel6 Android14 我认为配置了<intent-filter> 和在域名服务器上部署了证书后应该就能跳转才对。不知道是哪里错了。。 还有就是有没有比较好的 Android 开发社区,大佬们推荐一下! 下面是我的代码 AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/logo"
android:roundIcon="@mipmap/logo_round"
android:label="@string/roll"
android:supportsRtl="true"
android:theme="@style/Theme.Hello"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/Theme.Hello">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<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" />
<data android:host="tw.eekda.com" />
<data android:pathPrefix="/open" />
</intent-filter>
</activity>
</application>
</manifest>
debug 证书地址: https://tw.eekda.com/.well-known/assetlinks.json
这是我跳转 url 的 Button 代码
openApp(){
const isAndroid = /Android/i.test(navigator.userAgent);
if (isAndroid) {
const uurl = `https://tw.eekda.com/open`;
// 尝试打开 APP 或者跳转到应用商店
window.location.href = uurl;
} else {
// 如果是其他平台(如 iOS )
alert("只支持 android")
}
},
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.