Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make lasting changes to config.xml in Ionic project

Following Google Firebase's instructions (step 7) I'm trying to add the following to my config.xml file (in an Ionic project):

<universal-links>
    <host name="abc123.app.goo.gl" scheme="https" />
    <host name="my-app.firebaseapp.com" scheme="https">
        <path url="/__/auth/callback"/>
    </host>
</universal-links>

But each time I emulate the app the inserted code gets removed. How can I add the required code to the config.xml and keep it there without Ionic (or Cordova) removing the modifications.

like image 452
Ben Fransen Avatar asked Mar 23 '18 13:03

Ben Fransen


People also ask

Can we use config XML to rename the Ionic app?

The Ionic framework application name can be changed in the config. xml file, Go to your applications config. xml file and change the name in the tag that is responsible for your app name.

Where is AndroidManifest XML in Ionic?

xml ​ Android apps manage permissions, device features, and other settings in the AndroidManifest. xml file, which is located at android/app/src/main/AndroidManifest. xml .

What is Ionic config JSON?

ionic/config. json , and project configuration files, usually at the project's root directory as ionic. config. json . The CLI provides commands for setting and printing config values from project config files and the global CLI config file.


1 Answers

the simple solution for this is to run a cordova clean before running any further ionic build/run.

  1. Make your /config.xml changes
  2. Run cordova clean
  3. Run your ionic command (which rebuilds the config within platforms) like ionic cordova run android

I often run it as a concatenated command if I'm experimenting with config.xml, ie cordova clean; ionic cordova run android;

like image 109
Mark Terrill Avatar answered Nov 02 '22 23:11

Mark Terrill