Chrome Mobile Intent URL for Testing Multiple Android Package Names

I use the intent URL to launch the application from Chrome mobile, or if the application is not installed back to the URL. It is described at https://developer.chrome.com/multidevice/android/intents .

Now I came across an application that exists with two different package names.

Is there any URL syntax or other solution that allows me to try two different package names before returning to the URL?

Preferred Solution:

  • Try opening package name A.
  • If A does not exist, try opening package name B.
  • If none of them are installed, go to the backup URL in mobile Chrome.
+5
source share
3 answers

there is no syntax for you to do this. But maybe some compromise solution might solve your problem.

1 you specify an action instead of a package

2, if you can not choose the first solution, you can make two browser_fallback_url.The first browser_fallback_url just directly send the intention to open the application B

0
source

So, I think one solution could be this:

  • lets say you are on the web page www.myweb.com/index.html
  • there you set the first intention, and as a backup, the same URL: www.myweb.com/index.html?number_of_tries=1 (adding a parameter can be any)
  • in javascript code you can understand that if this parameter is present, then you should try the second package
  • call the second intent and use your real backup URL www.myweb.com/my_real_fallback.html as a backup (for example)
0
source

You must have three URLs, such as URL1, URL2, URL3.

  • URL1 tries to open package name A. If A does not exist, redirect URL2.
  • URL2 tries to open the name of package B. If B does not exist, redirect URL3.
  • URL3 just opens in the default browser.
0
source

Source: https://habr.com/ru/post/1244979/


All Articles