Android Deep linking omit certain url

前端 未结 2 988
旧巷少年郎
旧巷少年郎 2020-12-30 04:05

I have implemented deep linking to my app successfully but I am stuck with a problem.


    

        
相关标签:
2条回答
  • 2020-12-30 04:14

    If I understand your problem correctly you want to exclude a particular URL from a certain list of URLs. What you tried was a good way to do that.

    android:pathPattern doesn't understand the complicated regex pattern as you said.

    I think the only way to solve your problem is to change the URL which you want to omit. Change the host or a part of that URL, or change the name example.com to, say, example2.com/hello/redirect/.

    0 讨论(0)
  • 2020-12-30 04:15

    The Android deep linking mechanism does not provide a way to explicitly exclude some URLs: you can either include explicitly paths with android:path, include paths matching a prefix with android:pathPrefix or matching a wildcard with android:pathPattern where you can use * or .*.

    In your case, you will have to either use "/" and have every link to your website opened with your app (including your homepage), or have every deep link share a common prefix.

    You can also have a look at airbnb's DeepLinkDispatch library, which seems to allow excluding specific URLs.

    0 讨论(0)
提交回复
热议问题