Feature Request: Access to IOS plist

Feature Request: Access to IOS plist

It has been mentioned a few times including here: https://software.intel.com/en-us/forums/intel-xdk/topic/590741
But I thought to make an official request ;-)

Editing a few parameters on the plist would (amongst other things) do away with requiring some basic Cordova plugins like the Status Bar and Splashscreen.
The goal would be to simply make changes to plist in some fashion.  Which itself could be done with a plugin, or through adding the keys to the XML file, or compiling a .xcarchive instead of a.ipa, or another method.

I did try the xml route, but could not seem to make that work.  Any tips would be helpful ( if it is possible)  even though is is not supported.

I have not started looking at Android, so I am not sure if they have a similar workflow issue too.

Thanks for the XDK - and keep up the good work!

Jason

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Make a dummy plugin with plist entry that your app requires and include that plugin as a third-party local plugin. Your dummy plugin will look like this:

<?xml version="1.0" encoding="UTF-8"?>
<plugin
    xmlns="http://apache.org/cordova/ns/plugins/1.0"
    id="dummy-plugin"
    version="0.0.1"
>
    <name>My Dummy Plugin</name>

    <description>Add an entry into plist</description>
    <license>BSD-3</license>

    <preference name="myPluginname" />

    <engines>
        <engine name="cordova" version=">=3.0.0" />
    </engines>

    <!-- ios -->
    <platform name="ios">
        <config-file target="*-Info.plist" parent="CFBundleURLTypes">
            <array>
                <dict>
                    <key>myKey</key>
                    <string>myString</string>
                </dict>
            </array>
        </config-file>
    </platform>
</plugin>

 

I did try making one before, and successfully added it via the plugin manager - though it did not seem to work for me.  Likely I did something wrong the first time, so I will try again using this.

Thanks very much for the pointer, and for taking the time, it is appreciated.

Jason

Thanks for your help, I managed to get it working.  I had been using the wrong tags before.
Below are some steps so it might help others:

This custom plugin makes the status bar hidden at launch.  IE: it will always be hidden, and not show, then hide after a couple of seconds.  This enabled me to remove the core cordova status bar plugin that comes with the XDK.

Save the text below as plugin.xml
Create a folder on disc (not inside your project) which only has the plugin.xml file inside
From the XDK Plugin Manager click on "Add plugin to this project"
Choose Third-Party Plugins>Import Local Plugin and point to the folder (not file)
The name, ID, version and engine are read from the xml file and shown in the plugin manager
The name and ID need to be different
Once imported, look under your project's plugin folder, where the plugin.xml can be edited.

Inside the xml file, making the parent the key, will show it at the top level in the plist.
For this plugin, I found I could just put boolean true or false without the need for an array, dict, string or boolean tag.

Below is the minimum amount information I could see to make the plugin still work.  See specs:
https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html

<?xml version="1.0" encoding="UTF-8"?>
<plugin
    xmlns="http://apache.org/cordova/ns/plugins/1.0"
    id="plist-plugin"
    version="0.1"
>
    <name>Plist Additions</name>

    <engines>
        <engine name="cordova" version=">=3.0.0" />
    </engines>

    <platform name="ios">
        <config-file target="*-Info.plist" parent="UIStatusBarHidden">
                <true/>
        </config-file>
        <config-file target="*-Info.plist" parent="UIViewControllerBasedStatusBarAppearance">
            <false/>
        </config-file>
        </platform>
</plugin>

 

Attachments: 

AttachmentSize
Downloadimage/png PluginManager.png16.77 KB

Leave a Comment

Please sign in to add a comment. Not a member? Join today