2

i am trying to open the app for a specific URL using AppLinking or DeepLinking

As per what i have understood :

<data android:scheme="http"
    android:host="example.org"
    android:pathPrefix="/app"/>

i have to follow this format for receive a request with URL : http://example.org/app/......

but my concern is that i have two URLS https://example.org/somestring (URL to open product description) ProductDescActivity https://example.org/somestring-VS-somestring (URL to open Product comparison) ProductCompActivity

i have defined the structure in mainfest file like above but i dont have a fixed PathPrefix value

<data android:scheme="http"
    android:host="example.org"
    android:pathPrefix="?????????"/>

if i add this structure to both my activity then might both the activity opens up

How to manage the request and do a AppIndexing for this kind of url request where the pathPrefix is not fixed or to be more straight how to handle URL without any sub domains

Peter
  • 1,069
  • 2
  • 13
  • 24
  • You can never open two activities at once. What happens if there's an overlap is you get a chooser that asks you to choose which app to use- and your app will be listed twice. Its rather confusing actually. – Gabe Sechan Jun 20 '17 at 08:05
  • @GabeSechan ohh i got you , ok ok their will be two app launcher icons in the list , one for Activity A and other for B , this is not good ! Anyway! thanx for your concern ! appreciate it – Peter Jun 20 '17 at 08:36

1 Answers1

2

Try to keep the app linking to main activity means this

<data android:scheme="http"
    android:host="example.org"
    />

will be specified in the mainActivity , and in mainActivity detect the URL type as you know of it, and then from mainactivity direct it to the specific activity ProductDescription or ProductComparison

second option is that you specify the URL with a pathprefix say XYZ and at the server end redirect the URL to the actual URL

<data android:scheme="http"
    android:host="example.org"
    android:pathPrefix="XYZ"/>

https://example.org/XYZ/somestring -----> redirect to https://example.org/somestring

Avtar Singh
  • 59
  • 1
  • 9
  • what about the second pause that i will face during transferring the call from mainactivity to PD or PC . have you tried this thing ever !!! was the lag not that worth noticing !!! Liked your second option tough too – Peter Jun 20 '17 at 07:46