简体   繁体   English

如何在Cordova 3.0自定义插件中添加第三方框架?

[英]How to Add a Third Party Framework to a Cordova 3.0 Custom Plugin?

I'm trying to create a cordova plugin with a third party framework (in this case AdColony.framework) https://github.com/AdColony/AdColony-iOS-SDK . 我正在尝试使用第三方框架(在本例中为AdColony.framework) https://github.com/AdColony/AdColony-iOS-SDK创建一个cordova插件。 I'm having trouble figuring out how to add this framework using the plugin.xml ( Plugin Specification ). 我在弄清楚如何使用plugin.xml( 插件规范 )添加此框架时遇到了麻烦。

I tried to include the file as a framework through 我试图通过以下方式将文件作为框架包括在内

<framework src="src/ios/libs/AdColony.framework" />

OR 要么

<source-file src="src/ios/libs/AdColony.framework" framework="true" />

But both didn't worked. 但是两者都没有用。 Please help me to figure this out. 请帮我解决这个问题。 Any suggestions and response will be greatly appreciated. 任何建议和回应将不胜感激。 Thanks. 谢谢。

自定义框架可用于Cordova 3.4

<framework src="relative/path/to/my.framework" custom="true" />

This answer suggests it is not possible: How to copy a custom ios framework using plugin.xml on Phonegap 3 which suggests converting the framework into a static library and using that. 这个答案表明这是不可能的: 如何使用Phonegap 3上的plugin.xml复制自定义ios框架 ,这建议将框架转换为静态库并使用它。

This thread might be useful to you: http://osdir.com/ml/phonegap/2013-11/msg00176.html 该线程可能对您有用: http : //osdir.com/ml/phonegap/2013-11/msg00176.html

And you might want to follow along with this bug: https://issues.apache.org/jira/browse/CB-5238 , which appears to address what you want and was recently merged (so might make it into 3.2 or 3.3). 而且您可能希望遵循以下错误: https : //issues.apache.org/jira/browse/CB-5238 ,它似乎可以满足您的要求,并且最近已合并(因此可能合并为3.2或3.3) 。 It also has a workaround: 它还有一个解决方法:

1. a <resource-file> tag to copy the .framework folder and include in Xcode
2. a <framework> tag to add it to the "Link Binary with Libraries" section of the Build Phases of the project

(You can include default frameworks with the framework tag (of course, that is not what you are asking).) (您可以在framework标签中包含默认框架(当然,这不是您要的内容)。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM