open Ionic app Android from browser

时间:2015-07-31 19:26:23

标签: android ionic-framework

In my AndroidManifest.xml I stated the following as an example:

<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
        <intent-filter android:label="@string/launcher_name">
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </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="mywebsite.com" />
            <data android:scheme="http" />
            <data android:path="/.*" />
        </intent-filter>
    </activity>

And in the browser :

<a href="intent://mywebsite.com/#Intent;package=my.package.app;scheme=http;end;"/>Click

And I only get the application in Google Play, no spear as I hope, that I'll be doing wrong?

2 个答案:

答案 0 :(得分:1)

Take a look at this: Launch custom android application from android browser

You used http as the scheme, so the link on your website should also start with http://

答案 1 :(得分:1)

The basic syntax for an intent-based URI is as follows:

intent: HOST/URI-path // Optional host #Intent; package=[string]; action=[string]; category=[string]; component=[string]; scheme=[string]; end;

In your URI, you forgot to define the action.