2016-02-20 46 views
7

我遵循這個android教程(http://developer.android.com/training/app-links/index.html)在我的應用程序中實現應用程序鏈接功能。但是,當我使用adb shell dumpsys package d檢查鏈接策略時,它顯示在「應用程序驗證狀態」標題下,但狀態爲「未定義」,它根本不顯示在「用戶0的應用程序鏈接」標題下。android應用程序鏈接狀態未定義

我所做的是在AndroidManifest.xml:

<activity 
      android:name=".activities.SplashActivity" 
      android:label="@string/app_name" 
      android:noHistory="true" > 
      <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="http" android:host="myhost" /> 
       <data android:scheme="https" android:host="myhost" /> 
      </intent-filter> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
</activity> 

在我的應用程序,我用的是真正的主人。而這個活動是我的應用程序中唯一一個我設定方案和主機的活動。 在我的地盤,我說這個

[{ 

    "relation": 

[ 

    "delegate_permission/common.handle_all_urls" 

], 
"target": 
{ 

    "namespace": "android_app", 
    "package_name": "mypackage", 
    "sha256_cert_fingerprints": 

      [ 
       "myfingerprint1", 
       "myfingerprint2" 
      ] 
     } 
    } 

] 

我試圖從瀏覽器https://myhost/.well-known/assetlinks.json訪問此,它的工作原理。 但是,在我安裝應用程序後,等待一段時間,然後運行adb shell dumpsys package d,它只是說「未定義」。順便說一句,我正在M設備上測試它。

+0

@ShobhitPuri,這是一個巨大的,還包括一些私人信息。你認爲清單文件中有些可能的問題是什麼? –

+0

你解決了這個問題嗎?我面臨同樣的問題。 – Chamnap

+0

面臨同樣的問題。它只適用於從Play商店上傳的版本嗎? – thedarkpassenger

回答

1

面臨着同樣的問題。

現在我從應用程序鏈接網址生成縮短的網址。這會默認將其重定向到瀏覽器和瀏覽器,然後啓動應用程序。

不解決問題,但足以滿足我的要求。

0

看起來像link polices只有在從play store安裝應用程序時纔會更新。