Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keys in Info.plist not merged but overwritted #864

Open
3 tasks done
pavrda opened this issue May 22, 2020 · 0 comments
Open
3 tasks done

Keys in Info.plist not merged but overwritted #864

pavrda opened this issue May 22, 2020 · 0 comments

Comments

@pavrda
Copy link

pavrda commented May 22, 2020

Bug Report

When using together plugins that use pods, keys in Info.plist are not merged but overwritten.
It happens for example for plugins cordova-plugin-facebook4, cordova-plugin-googleplus and ionic-plugin-deeplinks. They all set CFBundleURLSchemes key in Info.plist. There should be contribution from each plugin but actually there is only one. Keys are not merged but overwritten.
I realized that this happens when <pods use-frameworks="true"> in plugin.xml is set. When set to false, keys are merged as expected.

Problem

What is expected to happen?

Keys are merged like this:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb1234567890</string>
        </array>
    </dict>
    <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>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>URL_SCHEME</string>
        </array>
    </dict>
</array>

What does actually happen?

There is only one key:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>fb1234567890</string>
        </array>
    </dict>
</array>

Information

Command or Code

Create blank cordova project, add plugins and check the result:

$ cordova create test test test
$ cd myApp
$ cordova plugin add cordova-plugin-facebook4 --variable APP_ID=value --variable APP_NAME=value
$ cordova plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=value
$ cordova plugin add ionic-plugin-deeplinks --variable URL_SCHEME=value --variable DEEPLINK_HOST=value
$ cordova platform add ios
$ less platforms/ios/test/test-Info.plist

After investigation in order to isolate plugin related bug I created as small as possible project to reproduce the bug fast: https://github.com/inited/cordova-plist-merge-fail

Environment, Platform, Device

Version information

Mac OS workstation:

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14.6
BuildVersion:	18G103

$ uname -a
Darwin boaz.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

$ cordova --version
9.0.0 ([email protected])

$ node --version
v10.13.0

$ npm --version
6.13.1

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant