chelo_c
chelo_c

Reputation: 1779

Ionic: hide Android App Launcher?

on android apps, when developing native Android app, one can hide it from launcher, so it only gets executed from intent of another app. With that I can hide the app icon on the home screen.

The way to do it in Android Native is:

remove this line from AndroidManifest.xml:

<category android:name="android.intent.category.LAUNCHER"/>

add this line to AndroidManifesst.xml:

<category android:name="android.intent.category.DEFAULT"/>

Is it posible to make the same thing using Ionic? How can I edit the built AndroidManifest?

Thanks!

Upvotes: 1

Views: 1086

Answers (1)

SolveSoul
SolveSoul

Reputation: 2648

You can do this using edit-config provided by Cordova. This can edit/replace XML nodes in the AndroidManifest.xml.

Here's an example how it should look for you:

<edit-config target="AndroidManifest.xml" target="/manifest/application/activity[@android:name='MainActivity']/intent-filter/category" mode="overwrite">
    <category android:name="android.intent.category.DEFAULT"/>
</edit-config>

MainActivity should be replaced by your activity's name, of course. Also note that this should be in the config.xml file under the <platform name="android"> node.

Upvotes: 1

Related Questions