Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
6.3.1
-
None
Description
Scenario
========
Creating a new cordova Plugin.
Setting preferences and default values in different platforms inside plugin.xml file.
Once the plugin is added to the project and built, resultant DEFAULT values aren´t loaded and set to 'undefined'.
PROJECT SAMPLE CODE PROVIDED
============================
Only relevant lines of code are included, everything else has been removed since is automatically generated by cordova.
<?xml version="1.0" encoding="utf-8"?>
<plugin id="cordova-plugin-sampleplugin" version="0.0.4"
xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<name>Plugin</name>
<preference name="SAMPLE_PREF_1" default="value1" />
<preference name="SAMPLE_PREF_2" default="value2" />
<preference name="SAMPLE_PREF_3" default="value3" />
<engines>
<engine name="cordova" version=">=3.4.0" />
</engines>
<asset src="www/SamplePlugin.js" target="js/SamplePlugin.js" />
<platform name="android">
<config-file parent="/*" target="res/xml/config.xml">
<preferences name="com.sample.plugin">
<preference name="samplepref1" value="$SAMPLE_PREF_1" />
<preference name="samplepref2" value="$SAMPLE_PREF_2" />
<preference name="samplepref3" value="$SAMPLE_PREF_3" />
</preferences>
</config-file>
</platform>
</plugin>
Given the following preference configuration and default values PROVIDED
the resultant config.xml file inside res/xml/config.xml (android example) contains all default values set to 'undefined'
<preferences name="com.sample.plugin">
<preference name="samplepref1" value="undefined" />
<preference name="samplepref2" value="undefined" />
<preference name="samplepref3" value="undefined" />
</preferences>
Attachments
Issue Links
- is related to
-
CB-11951 Plugin preference default value is not being saved to <platform>.json
- Closed