This guide is for third party developers who are ready to submit a plugin for availability in the Corona Marketplace.
If you are new to the concept of plugins and how to create them, please see our Plugins guide.
Plugins are distributed differently depending on the product for which it will be used.
Your plugins will be hosted live on Corona's build servers, immediately available to all Corona SDK developers. When a Corona SDK developer creates a project that requires your plugin, the build server automatically integrates the plugin during the build process.
If you have a plugin written in pure Lua README
files.
If your plugin is written in native code or hybrid native+Lua, it should be submitted via a bitbucket repo that has been shared with you. The structure of that repo must follow a particular format.
When you have an update to your repo, you can generate a pull request.
To help you get started, we have created a plugin submission template that contains starter files, with the exception of the plugins
binary directory.
You should package up your files in the following structure:
metadata.json
— Core information about your plugin; see metadata.json below.plugins/
${VERSION}/
— Build version, for example 2016.2992
; see Version Targeting below.
android/
.jar
or .so
binary.metadata.lua
— See metadata.lua below.resources/
package.txt
— Contains the name of the package for which to generate a R
file.assets/
— This folder contains files to be added to the assets folder and can be retrieved via the assets manager.res/
— This folder contains files you want to put in the res
folder and can be accessed via getIdentifier or by accessing the R
file of the package under package.txt
. The structure of the subfolder is exactly the same as the res
folder.iphone/
.a
binary (ARMv7).metadata.lua
— See metadata.lua below.resources/
This folder will contain all the resources you want in the app. It is relative to the root app directory.iphone-sim/
.a
binary (i386).metadata.lua
— See metadata.lua below.resources/
— This folder will contain all of the resources you want in the app. It's relative to the root app directory.mac-sim/
.dylib
binary or Lua plugin.win32-sim/
.dll
binary or Lua plugin.This JSON file contains information about the publisher, the name of the plugin as it appears in Lua, and other related information, for example:
{ "contact": "me@mycompany.com", "url": "http://www.mycompany.com", "pluginName": "plugin.mylibrary", "publisherId": "com.mycompany" }
The plugin submission template contains a metadata.json
file that should be updated with the appropriate information.
The per-platform metadata.lua
file describes properties of the plugin binary. This file is required for Android, iOS, and the iOS Simulator.
.jar
and .so
are supported. In addition, you can specify elements in the AndroidManifest.xml
file that need to be modified in order to accommodate the plugin.If you're developing a plugin that depends on the Android Support Libraries or Google Play Services, please read our Android Dependency Integration guide.
For iOS and the iOS Simulator, the metadata.lua
files should be the same. In both, you specify the format of the binary. Currently, only static libraries (.a
) are supported.
You can declare dependencies through the coronaManifest
section. These plugins will be downloaded and bundled with your own during a Corona Simulator build.
The plugin submission template provides stub versions. Here are some examples:
local metadata = { plugin = { format = "jar", manifest = { permissions = {}, usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS_NETWORK_STATE", "android.permission.READ_PHONE_STATE", }, usesFeatures = {}, applicationChildElements = { -- Array of strings [[ <activity android:name="com.mycompany.MyActivity" android:configChanges="keyboard|keyboardHidden"/> ]], }, }, }, coronaManifest = { dependencies = { ["shared.memoryBitmap"] = "com.coronalabs", }, }, } return metadata
local metadata = { plugin = { format = "staticLibrary", -- This is the name without the "lib" prefix -- In this case, the static library is called "libplugin_openudid.a" staticLibs = { "plugin_openudid", }, frameworks = {}, frameworksOptional = {}, }, coronaManifest = { dependencies = { ["shared.memoryBitmap"] = "com.coronalabs", }, }, } return metadata
In regards to frameworks, Corona automatically links to the following frameworks. If you need to link against additional frameworks, you can specify them as either required inside the frameworks
table or optional (weak linking) inside the frameworksOptional
table. When you specify them, please omit the .framework
extension.
AddressBook
AddressBookUI
AssetsLibrary
AudioToolbox
AVFoundation
CFNetwork
CoreGraphics
CoreLocation
CoreMedia
CoreMotion
Foundation
GameKit
iAd
ImageIO
MapKit
MediaPlayer
MessageUI
MobileCoreServices
OpenAL
OpenGLES
Photos
QuartzCore
Security
StoreKit
SystemConfiguration
UIKit
Additionally, for backward iOS version compatibility, Corona weak links against the Accounts
, AdSupport
, Social
, and Twitter
frameworks.
In order for your plugin to be used successfully, you should provide complete and accurate documentation. Plugin documentation must be written in Markdown .markdown
or .md
extension)
As a starting point, we recommend using our Plugin Docs Template.
For Android, resources can be included into the assets
or the res
directory in the resulting .apk
after a build.
To package resources into the assets
directory, put the resources into the assets
folder indicated below. The directory structure will be persist through the build process.
plugins/
${VERSION}/
— Build version, for example 2016.2992
; see Version Targeting below.
android/
resources/
assets/
— This folder contains files to be added to the assets folder and can be retrieved via the assets manager.To package resources into the res
directory, put the resources into the res
folder indicated below. This res
folder can contain subfolders which are the same folders as a native Android build, for example drawable
, layout
, etc.
plugins/
${VERSION}/
— Build version, for example 2016.2992
; see Version Targeting below.
android/
resources/
res/
— This folder contains files you want to put in the res
folder and can be accessed via getIdentifier or by accessing the R
file of the package under package.txt
. The structure of the subfolder is exactly the same as the res
folder.To generate a custom R
file for your plugin, you must include a package.txt
file inside the android
folder as indicated below. This file should contain the package name for the R
file.
plugins/
${VERSION}/
— Build version, for example 2016.2992
; see Version Targeting below.
android/
package.txt
To include resources in the .app
bundle, put them into the resources
folder indicated below. These resources will be added to the bundle relative to the base directory. For example, if you put example.png
into the resources
folder, it will be included like example.app/example.png
.
plugins/
${VERSION}/
— Build version, for example 2016.2992
; see Version Targeting below.
iphone/
resources/
This folder will contain all the resources you want in the app. It is relative to the root app directory.iphone-sim/
resources/
— This folder will contain all of the resources you want in the app. It's relative to the root app directory.When a plugin is published to Corona's servers, you must specify a
For example, if you want your plugin to be supported in build 2016.2992 or later, you should use 2016.2992
for ${VERSION}
per the directory structures shown above. Then, in your documentation or elsewhere, you would tell developers to install Corona SDK version 2016.2992 or later to access the plugin.
When you build your plugin binary, you should use the corresponding version of Corona Enterprise. For example, if you choose to support Corona SDK version 2016.2992 or later, you should build it using CoronaEnterprise 2016.2992
For new plugins, we highly recommend that you support the most recent public release. This ensures that your plugin is available to the broadest audience possible.
Normally, when you update a plugin binary, you simply
In this situation, you should deploy a separate plugin binary. This binary will correspond to a different/newer build version of Corona SDK. A developer can then simply obtain that version to access the newer version of the plugin. In this manner, you can keep the legacy plugin binary around to preserve backwards compatibility.
For example, here's what your plugins
directory might look like:
plugins/
2016.2096/
— Contains the older, legacy plugin binaries.2016.2112/
— Contains the newer plugin binaries.At a minimum, you will need to supply a Lua plugin stub for all platforms, including versions for Windows and macOS. These stubs should allow Corona SDK developers to make calls as they would on a
Under the build version of the plugin folder, you should supply your plugin implementations within the folders named android
, iphone
, iphone-sim
mac-sim
win32-sim
.dll
and .dylib
files for the Corona Simulator?If the plugin does not have an implementation for Windows or macOS, we recommend creating Lua stub files (see above).
If you wish to provide Simulator plugin implementations, you will need to use Visual Studio (Windows) or Xcode (macOS). Some useful guidelines can be found here:
.dll
).dylib
)iphone
and iphone-sim
folder?When you submit a plugin, two versions should be submitted. The iphone
folder should contain the ARMv7 plugin and the iphone-sim
Resources can be included. Please follow the template in this repo.
.so
) plugin creation?The native library (.so
) plugin should be built with the Android NDK labeled android-ndk-r10d
.
We recommend uploading sample code to a GitHub repo and linking to it from within the plugin documentation index.markdown
on the header section's > __Sample__
The plugin can be tested using Corona Enterprise by linking the static library (iOS) or through including the library in your project's libs
directory (Android). After initial testing, you will need to submit the binaries to Corona Labs to test with Corona SDK.