1

I have the following link: https://thus.customapp.it/#/app/customapp/itemDetail/45289348293423

I want that this link is captured and opened with my app. So, I added these lines on AndroidManifest file:

<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="https" android:host="thus.customapp.it" android:pathPrefix="/#/app/customapp/itemDetail"/>
</intent-filter>

I also tried with:

<data android:scheme="https" android:host="thus.customapp.it" android:pathPrefix="/#/app/customapp/itemDetail/.*"/>

and this:

 <data android:scheme="https" android:host="thus.customapp.it" android:pathPattern="/.*/.*/.*/.*/..*"/>

and this:

  <data android:scheme="https" android:host="thus.customapp.it" android:android:pathPrefix="/#"/>

and this:

<data android:scheme="https" android:host="thus.customapp.it" android:pathPattern="/#/.*" />

but it doesn't work.

P.S. with the following code:

<data android:scheme="https" android:host="thus.customapp.it" android:pathPattern="/.*"/>

it works, but I need to intercept just a url which contains "itemDetail", and not, for example, https://thus.customapp.it/#/app/customapp/editItem/45289348293423

panagulis72
  • 2,129
  • 6
  • 31
  • 71

1 Answers1

1

Use

android:path="/%23/app/customapp/itemDetail/.* 

instead of

android:pathPrefix="/#/app/customapp/itemDetail/.*"

Edit: As suggested by @panagulis72 we should use %23 instead of #

GOVIND DIXIT
  • 1,748
  • 10
  • 27
  • Now the app intercepts the url, but I have the opposite problem now! Indeed if I choose to open the link the Chrome, it gives me 404 because the url with /%23/ doesn't exist, just /#/ exists – panagulis72 Jul 10 '19 at 07:02
  • Let me know if this helps you: https://stackoverflow.com/questions/11587744/why-uri-encoded-anchors-cause-404-and-how-to-deal-with-it-in-js – GOVIND DIXIT Jul 10 '19 at 09:42
  • I tried but it doesnt work, so I change the way and I built a redirect page on my web app, and I pass the parameters via query Parameters (even if the query parameters are ignored: https://stackoverflow.com/questions/56970072/nativescript-urlhandler-doesnt-intercept-queryparams-in-android-deep-link). Anyway thank you very much for you help! – panagulis72 Jul 10 '19 at 13:17