Brandon WongKS
Brandon WongKS

Reputation: 563

Adding custom cordova plugin to linked and embed framework in IOS XCode

I currently have this code in my custom cordova plugin,

<framework src="src/ios/Frameworks/XXX.framework" custom="true" embed="true"/>
<framework src="src/ios/Frameworks/XXXFramework.framework" custom="true" embed="true"/>

When I cordova build ios it will only go into embedded binaries but not linked frameworks and libraries. I wish to import both of the framework to both linked and embedded sections.

Please refer to Image below : Image

Any help would be appreciated, thank you.

Upvotes: 4

Views: 1570

Answers (1)

Joanne
Joanne

Reputation: 1236

For adding libraries to "Embedded Binaries" section in Xcode (Starting from cordova-ios 4.4.0 and cordova 7.0.0), put this in your plugin.xml:

<framework src="src/ios/XXX.framework"   embed="true" custom="true" />

For adding libraries to "Linked Frameworks and Libraries" section in Xcode, put this in your plugin.xml:

<source-file src="src/ios/XXX.framework" target-dir="lib" framework="true" />

Both of them can exist at the same time. For example:

<platform name="ios">
    ....
    <source-file src="src/ios/XXX.m"/>
    <source-file src="src/ios/XXX.framework" target-dir="lib" framework="true" />
    <framework src="src/ios/XXX.framework"   embed="true" custom="true" /> 
    ....  
</platform>

Upvotes: 6

Related Questions