Search code examples
info.plistxcframework

How to make XCFramework take into account the extra info.plist fields


I need to embed this library https://github.com/securing/IOSSecuritySuite into my own XCFramework module as dependency but there are two problems.

First, since I want to use my framework as binary, all of its dependencies must have the 'Build Libraries for Distribution' property set to 'Yes'. It can be achieved by placing all IOSSecuritySuite sources in separate XCFramework, setting the above property and adding it as dependency. Should work.

Second, the IOSSecuritySuite guide requires updating the main info.plist file of a project that uses this library by adding these lines:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>undecimus</string>
    <string>sileo</string>
    <string>zbra</string>
    <string>filza</string>
    <string>activator</string>
</array>

(Actually it's demanded by Apple documentation when you use the canOpenUrl method)

But I want to encapsulate all the functionality in a framework so that no additional project configuration is required. And here's the problem. If you open your XCFramework in Xcode you can see 'Info.plist Values' in Build Settings of each target and project but they don't allow you to add new fields. I didn't find any other info.plist there. One info.plist file is created when you convert your framework in an archive, but its only function is simply to describe the package. So I don't know how to add these info.plist lines to the framework so that it will take this into account. I suspect if I just put my custom info.plist in the framework folder it won't work. Probably I don't know some elementary things. I will glad for any hints :)


Solution

  • I figured out:

    1. "Info.plist Values' in Build Settings of each target and project but they don't allow you to add new fields" - you can add fields to the "info" section of the project. This will automatically create physical info.plist in your project folder and framework will see it.

    2.macOS is the only one of our platforms that supports nested frameworks https://developer.apple.com/forums/thread/128117 so you are forced to mix all sources in one framework.