android app链接状态未定义

前端之家收集整理的这篇文章主要介绍了android app链接状态未定义前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我按照这个 Android教程( http://developer.android.com/training/app-links/index.html)在我的应用程序中实现应用程序链接功能.但是,当我检查链接策略与adb shell dumpsys软件包d时,它显示在“应用程序验证状态”标题下,但状态为“未定义”,它根本不显示在“用户0的应用程序链接标题下.

我做的是在AndroidManifest.xml中:

  1. <activity
  2. android:name=".activities.SplashActivity"
  3. android:label="@string/app_name"
  4. android:noHistory="true" >
  5. <intent-filter android:autoVerify="true">
  6. <action android:name="android.intent.action.VIEW" />
  7. <category android:name="android.intent.category.DEFAULT" />
  8. <category android:name="android.intent.category.BROWSABLE" />
  9. <data android:scheme="http" android:host="myhost" />
  10. <data android:scheme="https" android:host="myhost" />
  11. </intent-filter>
  12. <intent-filter>
  13. <action android:name="android.intent.action.MAIN" />
  14.  
  15. <category android:name="android.intent.category.LAUNCHER" />
  16. </intent-filter>
  17. </activity>

在我的应用程序中,我使用真正的主机.这个活动是我的应用程序中唯一一个我设置方案和主机的活动.
在我的网站上,我添加了这个

  1. [{
  2.  
  3. "relation":
  4.  
  5. [
  6.  
  7. "delegate_permission/common.handle_all_urls"
  8.  
  9. ],"target":
  10. {
  11.  
  12. "namespace": "android_app","package_name": "mypackage","sha256_cert_fingerprints":
  13.  
  14. [
  15. "myfingerprint1","myfingerprint2"
  16. ]
  17. }
  18. }
  19.  
  20. ]

我尝试从https://myhost/.well-known/assetlinks.json的浏览器访问它,它的工作原理.
但是,在我安装应用程序之后,等待一段时间并运行adb shell dumpsys包d,它只是说“未定义”.顺便说一句,我在M设备上测试它.

解决方法

对我来说,服务器返回了assetlink文件的无效标头.您可以点击以下网址,查看您的assetlink文件是否有效.只需用你的url替换url中的example.com域:

https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=http://example.com&relation=delegate_permission/common.handle_all_urls

猜你在找的Android相关文章