[ 
https://issues.apache.org/jira/browse/CB-4731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13822616#comment-13822616
 ] 

Braden Shepherdson commented on CB-4731:
----------------------------------------

If you're using cordova-cli, you can add a post-prepare hook to add this entry 
to the newly created plist file, exactly once.

As to the bugs, there are two related problems here. One is that spaces are 
getting added to places they shouldn't be; that bug is likely in the plist npm 
module for handling plist files, see [here|https://npmjs.org/package/plist]. It 
may instead be in the Plugman code, not certain.

The bug of adding these entries more than once is definitely in the Plugman 
code. There is sophisticated logic for XML files to de-dupe each entry, keeping 
a count of how many times we've been told to add it, so that we get a single 
entry that isn't removed until the last plugin that wanted the entry is 
uninstalled.

> Adding config entries in plugin.xml results in duplicate .plist entries
> -----------------------------------------------------------------------
>
>                 Key: CB-4731
>                 URL: https://issues.apache.org/jira/browse/CB-4731
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugman
>    Affects Versions: 3.0.0
>         Environment: macosx
>            Reporter: Tim Croydon
>            Assignee: Braden Shepherdson
>            Priority: Minor
>
> I have the following in the plugin.xml file for a custom plugin:
> {code}
> <platform name="ios">
>     <config-file target="*-Info.plist" parent="UIBackgroundModes">
>         <array>
>            <string>location</string>
>            <string>voip</string>
>         </array>
>     </config-file>        
> </platform>
> {code}
> However, this does not generate the expected entries in the .plist file. I 
> get:
> {code}
> <key>UIBackgroundModes</key>
> <array>
>     <string>location</string>
>     <string>voip</string>
>     <string>location</string>
>     <string>voip</string>
> </array>
> {code}
> i.e. elements are repeated. I have tried with a single element in the source 
> plugin.xml and get the same result.
> I am using the cordova CLI to manage my plugins, platforms and build.
> (p.s. I'm new to Cordova so apologies if this is filed under the incorrect 
> component)



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to