I am currently making a plugin for phonegap 3. I have a custom framework to copy using the source-file directive. In the plugin.xml I tried:
Use <framework src="libs/ios/mylib.framework" />
.
Good news: it seems that the Cordova folks are working on this as we speak. There is a feature request as well as a commit to GitHub that claims to resolve this issue. The framework
tag will support the custom="true"
attribute. For example, here's how you could do it for the AWS iOS SDK Runtime framework:
<framework src="src/ios/Frameworks/AWSRuntime.framework" custom="true" />
UPDATE: It seems that this change made it into the current stable release of Cordova on 11/29/2013 (two days ago). Just update your Cordova and Plugman binaries and you should be good to go.
$ npm update -g cordova # if using `cordova plugin add xyz`
$ npm update -g plugman # if using `plugman install --platform x --project y --plugin z`
You can copy the binary file (who should be in "mylib.framework/Versions/A/") and the headers ( ".h" who should be in "mylib.framwork/Versions/A/Headers")
like this
<source-file src="libs/ios/mylib.framework/Versions/A/mylibBinary" framework="true" />
<header-file src="libs/ios/mylib.framework/Version/A/Headers/mylibHeader.h" />
...
You also have to add the dependencies manually, IE.: this framework needs the iOS AVFoundation.framework
so, you need to add this too.
<framework src="AVFoundation.framework" />
One more thing you have to know, if you want to submit this plugin to PhoneGap.
Any application that contains binary libraries will be rejected. This is because we need to be able to see exactly what is in a plugin as part of our code review process. So when submitting a plugin make sure that it doesn’t contain binary libraries. (PhoneGap)