Why android does not handle a deeplink url which h

2019-08-01 08:52发布

The url http://javaexample.com/#/topics is a valid url?

I am try to deeplink the above url in the app using:

  <intent-filter android:label="@string/app_name">
            <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="javaexample.com"
                android:pathPrefix="/#/topics" />
        </intent-filter> 

but the terminal throwing message -

Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=http://javaexample.com/...

is url http://javaexample.com/#/topics is not a valid url if it has # in the path?

1条回答
Viruses.
2楼-- · 2019-08-01 09:25

The # in a URL indicates the beginning of the fragment component, which cannot be used for deep link criteria. Even though you've structured the fragment to look like a normal URL path to human eyes, the computer does not read it this way.

You'll need to reformat your URLs not to include any # character before the path.

查看更多
登录 后发表回答