A
A
Alexey2016-04-14 19:13:00
Android
Alexey, 2016-04-14 19:13:00

Launching an app from a link through mobile chrome?

The essence of the question is: It is
required to launch the application when clicking on the link in the browser. Everything works if you open the link from a third-party application (mail, skype, etc.). But when you try to open a link from a website (I tried it through Chrome and Opera), an Intent is launched with a search for an application on Google Play (as the documentation says, due to the fact that an application that can process this link was not found).
Code example:
Manifest:

<activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>

                <category android:name="android.intent.category.BROWSABLE"/>
            </intent-filter>

            <intent-filter>
                <action android:name="com.example.android.GO"/>
            </intent-filter>

            <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:host="views.example.com"
                    android:scheme="http"/>
                <data
                    android:scheme="http"
                    android:host="com.example.android"/>
            </intent-filter>
            <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="views" android:host="com.example.android"/>
            </intent-filter>
            </intent-filter>

Link options I tried to run:
<a href="intent://scan/#Intent;scheme=views;package=com.example.android;end"> Go on </a>
<a href="intent://scan/#Intent;scheme=http;package=com.example.android;end"> Go on http</a>
<a href="intent://scan/#Intent;package=com.example.android;end"> Go on no scheme</a>
<a href="intent://scan/#Intent;package=com.example.android;action=com.example.android.GO;end"> Go on action</a>
<a href="intent://scan/#Intent;action=com.example.android.GO;end"> Go on action no package</a>
<a href="http://views.example.com"> Go on EASY</a>

Moreover, if you use the example specified in the documentation: then it actually does not work either...
https://developer.chrome.com/multidevice/android/i...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2016-04-14
@Alexey29

and this "scan" why?
here is an example of opening whatsapp

<a href="intent://send/4915122962149#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question