Open android-app scheme with Chrome on Android Open android-app scheme with Chrome on Android google-chrome google-chrome

Open android-app scheme with Chrome on Android


You have to add <data../> describing URI in intent-filter for your component, like so,

<intent-filter>   ...   <data android:scheme="android-app"/></intent-filter>

and on your site part define intent like this

intent:#Intent;scheme=android-app;package=your_package;end

UPDATE.Didn't realize that scheme was a reserved one, although my solution works for any scheme you define.I looked up the sources of the Intent class it seems you have to define your URI like this

android-app://your_package

OR

android-app://your_package/ #Intent;action=com.example.MY_ACTION;end

First line of the parseUri method in the Androids Intent class

final boolean androidApp = uri.startsWith("android-app:");

Worth to mention: This scheme was added on API 22.

I've tested it works with a tag, and as @tynn mentioned in the comments also for window.open() and location.href and not working from the address bar in Chrome.