This guide will teach you how to continue developing your Cocoon.io project locally.
Getting your Project from Cocoon.io
In order to get your full project, first you need to download the source code clicking in the button highlighted in the Figure 1.
This will provide you with the zip that you uploaded the last time you updated the project. If you made any modification in the SETTINGS section of your project, or you didn’t include any config.xml in your latest update, you will need to copy the CONFIG.XML and create a config.xml file in your project.
You should have now the project downloaded in your computer.
Installing Apache Cordova
The website of Apache Cordova has a clear and concise Get Started guide that you can follow.
Things you should install from the guide:
- The Cordova CLI
- Android Tools (In case you are building for Android)
- iOS Tools (in case you are building for iOS, you need a Mac for this)
If you followed the guide correctly you should have a working demo app of Cordova and it should mean you have installed Cordova correctly.
You can run cordova requirements at any time in your project folder to see if all the requirements and dependencies for your project are met.
Turning your Cocoon.io Project into a Cordova Project
Cordova will identify your Cocoon.io project as a Cordova project by default, but you have to deal with three things before being able to compile it.
The first one is that there are no platforms added in the config.xml file you exported from Cocoon.io. That is easily fixed by using the command cordova platform add <platform>.
Sadly, if the Operative System is not MacOS, Cordova won’t be able to compile for it or for iOS.
Secondly, you might have been using private plugins of Cocoon.io and Cordova won’t be able to find them. To solve this Cocoon.io is open sourcing a big part of its code. You will have to replace the code referencing the private plugins for new references to the open sourced plugins.
Canvas+ and Webview+
Canvas+ is not going to be opened to the public at the moment because of still ongoing contractual agreements so the project should be migrated to use the standard system webview instead of Canvas+.
Removing Canvas+ requires two things, first removing the Canvas+ plugin from the config.xml file and second remove the specific Canvas+ APIs from the JS code in case you are using any and migrate those to Cordova plugins providing the same functionality.
Removing the Canvas+ plugin
To remove the Canvas+ plugin from your project you just need to remove the following lines from the config.xml:
<plugin name="com.ludei.canvasplus.android" spec="*"/>
<plugin name="com.ludei.canvasplus.ios" spec="*"/>
Removing/replacing Canvas+ APIs
You can find all the Canvas+ APIs here.
|Cocoon API||Cordova Plugin|
|Cocoon.Motion||Replace with browser API|
|Cocoon.Proxify||There is no replacement for this but you shouldn’t really need this when using the system Webview.|
|Cocoon.Touch||There is no replacement for this but you shouldn’t really need this when using the system Webview.|
|Cocoon.Utils||There is no translation for most of the API methods here but you can use the cordova-plugin-media-capture for all related for screen capturing.|
|Cocoon.Widget||There is no replacement for this but you shouldn’t really need this when using the system Webview.|
Removing the Webview+ plugin
Removing the Webview+ is the most straightforward case. You simply remove the following plugins and everything should work just fine:
<plugin name="com.ludei.webviewplus.android" spec="*"/>
<plugin name="com.ludei.webviewplus.ios" spec="*"/>
Signing the App
Cocoon Could service handled the signing automatically just providing the keystores and the password for it. Signing with Cordova it’s quite similar, you just need to do it from the command line but as long as you have the keystores and the passwords you are good to go.
You have all the information about how to sign for Android from the command line with the Cordova CLI here.
You have all the information about how to sign for iOS from the command line with the Cordova CLI here.
Testing with the DevApp
The code of the DevApp will be released as well. It is in the form of a plugin that you can install like any other of the plugins that we will release. When a compilation with the DevApp plugin installed is issued the plugin replaces the code of your app for the code of the DevApp. Since it uses the same config.xml, the configuration of the DevApp will be the same of your project.
Cocoon Cloud alternatives
In case you prefer not to use the Cordova CLI for building your apps, there are a few Cordova base cloud services that might serve the purpose as long as you update the config.xml to not use Canvas+ or Webview+.