重定向网址的Android深层链接

Dal*_*ngh 9 android

  1. 我的应用程序配置为处理深层链接“ xyz”
  2. 然后有一个链接“ abc”,它使用http 302重定向到“ xyz”
  3. 如果使用chrome打开“ abc”,则chrome将其重定向到“ xyz”,然后打开我的应用
  4. 但是,如果在Gmail中打开了“ abc”,则Gmail会将其重定向到“ xyz”,但不会打开我的应用程序。
  5. 我在Gmail中知道,如果用户转到选项->使用chrome打开->这将导致行为(3)
  6. 但是,有没有什么解决方案可以让Gmail在重定向网址后打开我的应用程序?

小智 -2

在您的清单中尝试此操作,并使用完整的网址(例如: http: //www.example.com/dl/appname ?page=1&item=1)而不是快捷方式网址 gmail不支持快捷方式网址,因为它有自己的网页浏览..

<intent-filter 
    android:autoVerify="true" 
    tools:node="merge">
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data
        android:host="ur_host" // www.example.com/
        android:pathPrefix="any_prefix" // /dl/appname
        android:scheme="https or http"/> //http
</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="urScheme"/> //example
</intent-filter>
Run Code Online (Sandbox Code Playgroud)