我已经使用 My Local APK 成功实现了 Android App 链接,并且它可以工作。当我在 Google Play 商店中发布相同的 APK 时,我发现我需要使用 Google 提供的指纹更改我的 /.well-known/assetlinks.json 中的 SHA 256 指纹。所以我改变了它。不幸的是,谷歌似乎保留了旧的assetlinks.json 副本,这会破坏我的应用程序链接。
我检查了 https://developers.google.com/digital-asset-links/tools/generator,它说“没有为 [your-app] 找到应用深层链接权限”
我检查了 https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=[my-site]&relation=delegate_permission/common.handle_all_urls它向我显示了旧版本的assetlinks.json
我的机器人.txt
User-agent: *
Disallow:
我在目录 /.well-known 中的 .htaccess 文件
Require all granted
RewriteEngine Off
<FilesMatch "\.(txt)$">
Require all granted
</FilesMatch>
<FilesMatch "\.(txt)$">
Allow from all
</FilesMatch>
我的assetlinks.json
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target" : { "namespace": "android_app", "package_name": "my-app-id",
"sha256_cert_fingerprints": ["my-sha-256-provided-by-gogole-play-console"] }
}]
https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=[my-site]&relation=delegate_permission/common.handle_all_urls的结果
{
"statements": [
{
"source": {
"web": {
"site": "https://my-host."
}
},
"relation": "delegate_permission/common.handle_all_urls",
"target": {
"androidApp": {
"packageName": "my-app-id",
"certificate": {
"sha256Fingerprint": "the-old-sha-256-fingerprint"
}
}
}
}
],
"maxAge": "534347.929731888s",
"debugString": "********************* ERRORS *********************\nNone!\n********************* INFO MESSAGES *********************\n* Info: The following statements were considered when processing the request:\n\n---\nSource: Web asset with site https://my-host. (which is equivalent to 'https://my-host')\nRelation: delegate_permission/common.handle_all_urls\nTarget: Android app asset with package name my-app-id and certificate fingerprint the-old-sha-256 \nWhere this statement came from:\n Origin of the statement: Web asset with site https://my-host. (which is equivalent to 'https://my-host')\n Include directives followed (in order):\n \u003cNone\u003e\nMatches source query: Yes\nMatches relation query: Yes\nMatches target query: Yes\n\n--- End of statement list. ---\n\n\n"
}
the-old-sha-256 与我实际assetlinks.json 中的SHA 256 不同
PS my-app-id、my-host、[my-site] 等都是占位符。
那么......如何强制谷歌读取我当前的assetlinks.json而不是使用旧的缓存版本?