Add entry to iOS plist file

#1

Hi there,
I need to automatically add a new config value to the iOS plist file. The way I understand it, is that the “cordova-build-override” is available for this. Unfortunately I wasn’t able to figure out what it expects, due to missing documentation. Here is what I tried:

cordova-build-override/config.xml

<widget id="tld.example.appname" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <platform name="ios">
        <config-file platform="ios" target="*-Info.plist" parent="Disable_badge_clearing">
            <string>YES</string>
        </config-file>
    </platform>
</widget>

What I need is an entry of Disable_badge_clearing as Boolean on YES (true).

Any help would be much appreciated.

#2

I never got this working with the override approach. So I am using my own custom Cordova plugin that sets the plist entries as I need them. Here’s a sample I am using in my apps:

Feel free to fork it and set your own flags.

In newer Meteor versions, you can install such a local Cordova package directly.

To make it available in older Meteor apps, upload it to Github like I did and use a private Atmosphere package, placed in the packages folder, with a package.js like this:

Package.describe({
  name: 'concats:cordova-patches',
  version: '0.0.1',
});

Cordova.depends({
  "com.concats.cordova-plist-patches": "https://github.com/concats/cordova-plist-patches/tarball/bf479ebb725e9416fdd37f5e9e29dc87dbb0d3d2"
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.3');
});
#3

Thank you.

I’m using 1.5.1, how would I go about installing it directly from a local file?

#4

From the Meteor 1.2 change log, section Mobile:

Installing plugins from the local filesystem is now supported using file:// URLs, which should make developing your own plugins more convenient. It is also needed as a temporary workaround for using the Facebook plugin. Relative references are interpreted relative to the Meteor project directory. (As an example, meteor add cordova:phonegap-facebook-plugin@file://…/phonegap-facebook-plugin would attempt to install the plugin from the same directory you Meteor project directory is located in.)

1 Like
#5

I use cordova-custom-config plugin. May be you can try it