question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some Info.plist instructions appear unordered

See original GitHub issue

Plugins like cordova-plugin-googleplus need this added in the Info.plist

<config-file target="*-Info.plist" parent="CFBundleURLTypes">
      <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>REVERSED_CLIENT_ID</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>$REVERSED_CLIENT_ID</string>
            </array>
        </dict>
      </array>
    </config-file>

When we detect a config-file or edit-config tags we output something like this:

Plugin cordova-plugin-googleplus might require you to add 
    <dict>
      <key>CFBundleTypeRole</key>
      <key>CFBundleURLName</key>
      <key>CFBundleURLSchemes</key>
      <string>Editor</string>
      <string>REVERSED_CLIENT_ID</string>
      <array>
        <string>$REVERSED_CLIENT_ID</string>
      </array>
    </dict>
   in the existing CFBundleURLTypes entry of your Info.plist to work

Note that the keys appear first and then the other fields, while it should be key-value

The problem is we use a library we use to read the plugin.xml that converts the content to JS objects, and then convert the JS objects back to XML to show what the user should add to their Info.plist, but the conversion doesn’t work as expected.

Only happens when the edit-config or config-file tags include dictionaries

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jcesarmobilecommented, Jul 7, 2020

The order is only important for <dict> elements as they contain key-value elements, so <key>CFBundleTypeRole</key> should be followed by <string>Editor</string>. But it’s like that because it’s used for plist files, that are xml like, but not exactly the same, so I would understand that your library (or any xml library) doesn’t handle it.

Another possible approach in the CLI would be to read the edit-config and config-file tags content as text and display it as is.

0reactions
jcesarmobilecommented, Jul 7, 2020

what we read is the plugin.xml that contains the edit-config and config-file tags, so not sure if plist will work on them, but we can try

Read more comments on GitHub >

github_iconTop Results From Across the Web

Data is unordered in pList IOS Swift - Stack Overflow
Make a plist file like this. enter image description here. Then get the array and loop it let path = NSBundle.mainBundle().
Read more >
plist does not order items ! | MacRumors Forums
I am trying to read a plist and write to a file in my iPhone application NSString *finalPath = [path ...
Read more >
plist localization broken since App Store Connect API 2.1 update
In the past few hours (coinciding with the App Store Connect API 2.1 update) plist localization has stopped working on our builds submitted...
Read more >
How do I edit a .plist file? - Ask Different - Apple StackExchange
10. IIRC some plist are compressed though, which makes them unopenable in a text editor without decoding them first. · Well perfect, more...
Read more >
The Ultimate Guide to iOS Localization | Phrase
When a localized version of the app is created, Xcode also creates the localization version of InfoPlist.strings. Replace the corresponding key/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found