I know how to develop a native plugin and also create stubs for non-supported platforms. I would like to know how can I structure a hybrid plugin which would be composed of both native code + lua code.
The lua side would be basically used to perform some operations on the returned data from the native side in order to create a standard response for all platforms. I would do that in the lua side so I can use a unique code for both iOS and Android and also take advantage of the easiness of Lua.
A simple example would be a barcode plugin that returns the supported barcode format for the platform.
iOS uses the following value for EAN13 barcode: “org.gs1.EAN-13” while android uses “EAN_13”.
So, my lua code would have something like this:
local dicStandardFormatsToSystemFormats ={ ["UPC\_A"] = { android="UPC\_A", ios="org.iso.Aztec" }, ["UPC\_E"] = { android="UPC\_E", ios="org.gs1.UPC-E" }, ["EAN\_8"] = { android="EAN\_8", ios="org.gs1.EAN-8" }, ["EAN\_13"] = { android="EAN\_13", ios="org.gs1.EAN-13" }, ["CODE\_39"] = { android="CODE\_39", ios="org.iso.Code39" }, ["CODE\_39\_MOD\_43"] = { android="CODE\_39\_MOD\_43", ios="org.iso.Code39Mod43" }, ["CODE\_93"] = { android="CODE\_93", ios="com.intermec.Code93" }, ["CODE\_128"] = { android="CODE\_128", ios="org.iso.Code128" }, ["ITF"] = { android="ITF", ios="org.ansi.Interleaved2of5" }, -- ITF = "Inteleaved Two of Five" (i Two out of every five bars or spaces are wide (hence exactly 2 of 5)) ["ITF\_14"] = { android=nil, ios="org.gs1.ITF14" }, -- it is the ITF but with 14 digits ["RSS\_14"] = { android="RSS\_14", ios=nil }, ["RSS\_EXPANDED"] = { android="RSS\_EXPANDED", ios=nil }, ["PDF\_417"] = { android="PDF\_417", ios="org.iso.PDF417" }, ["DATA\_MATRIX"] = { android="DATA\_MATRIX", ios="org.iso.DataMatrix" }, ["QR\_CODE"] = { android="QR\_CODE", ios="org.iso.QRCode" }, }
So, direct to the question: Where should have that lua code in order to have it working together with the native plugin so I can package everything into a Corona plugin to submit to the marketplace? Is it inside the stub?