Add entry to iOS .plist file via Cordova config.xml

后端 未结 15 1528
日久生厌
日久生厌 2020-11-28 21:41

I am new to the Cordova CLI.

I need to perform the following steps programmatically via Cordova.

  1. In the project .plist add a new row
  2. Enter th
15条回答
  •  旧时难觅i
    2020-11-28 22:08

    If you are trying to modify a .plist in a native iOS plugin with a tag in your plugin.xml, here is what you need to do:

    1. Make sure your .plist is xml, not binary! You can use plutil to convert a binary .plist into xml, and commit it to version control.

      plutil -convert xml1 Info.plist

    2. The instructions for indicate that target= is relative to the generated xcode project at platforms/ios//, but I found that I needed to prepend a wildcard character to my path to get it to work:

      target="*/Resources/MyResources.bundle/Info.plist"

    3. If you want to add a key at the top level of the .plist, you need to set parent equal to the key name, and then nest a tag with the value. Using an or as any examples show will cause these keys to be nested under parent.

    Here is a complete example that works for me for adding multiple top level properties:

    
        
            Cordova
        
        
            3.2.0
        
    
    

提交回复
热议问题