Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova - Include .framework (swift 3) dependency as plugin

I have native code developed on swift 3. Basically this code generate a library with the .framework extension. I want to use this library as plugin on a apache cordova application but I cannot make it work. I looked over internet and there is a few post including this (Custom Cordova Plugin: Add framework to "Embedded Binaries") but this option's doesn't work with the latest versions of cordova (6+).

If I put the .swift files individually over my cordova project I can use it, so I think there is a problem to get the correct communication between cordova and the .framework library.

Anyone know how to accomplish this?

Thanks

like image 938
HolloW Avatar asked Jan 25 '18 16:01

HolloW


2 Answers

Latest Cordova Version is 8.0.0

Try like this:

<framework src="relative/path/to/my.framework" custom="true" embed="true" />
like image 72
jcesarmobile Avatar answered Oct 29 '22 08:10

jcesarmobile


I do agree with @jcesarmobile's answer. Also if you are looking for an elaborate steps for making cordova plugin with custom iOS framework, then you gotta look at this link.

It provides step by step explanation of creating a cordova plugin with Dynamsoft iOS barcode SDK. Hope this will help you to start off.

like image 32
Gandhi Avatar answered Oct 29 '22 09:10

Gandhi