incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Maj <>
Subject Re: Confusion
Date Wed, 14 Mar 2012 23:52:33 GMT

On 3/14/12 4:43 PM, "Johnny Ray" <> wrote:

>I was seeing this message in the cordova-js repo
>Scroll down to 'Supported Platforms' in the read me.

Yep, the only platform currently using cordova-js is Android. The iOS
implementation is about 90% of the way there. There is an iOS branch [1]
on my cordova-js fork that is housing those commits. There is also a
cordova-js branch on my cordova-ios fork that is housing the native-side
changes for cordova-js integration.

>Thanks for the plugin documentation. Suppose I wanted to simply extend
>the current core API, is there documentation on how to do that on the
>JavaScript side - the native stuff is easy enough. I suppose we're a bit
>confused on exactly how to accomplish that. There are so many repos out
>there is difficult to know what is up to date, what is being used by the
>community, what to fork if you want to contribute. We've gone through the
>wiki but some further guidance would be appreciated.

Every platform implements an exec function (which is stored under the
lib/exec folder). This function encapsulates sending messages from JS to
native on that specific platform. Your plugin needs to use the exec method
to send messages to native.

We are hiding all of this stuff away for now in a big closure in the
cordova.js file. You can shimmy your plugin code into that top-level
closure and get access to our minimalist require/define methods for
retrieving references to the various JS modules making up the cordova.js
file. Once you do that, calling "require('cordova/exec')" will return a
reference to the exec function for whatever platform cordova is currently
executing in.

Hope that helps,


>Johnny Ray
>On Wednesday, March 14, 2012 at 11:22 AM, Shazron wrote:
>> On Wed, Mar 14, 2012 at 8:04 AM, Johnny Ray <
>>(> wrote:
>> > A colleague and myself were trying to add functionality to the iOS
>>framework. When we were attempting to actually create the JS side code
>>we were a bit confused about things not seeming to work. Two things:
>> > 
>> > 1.) We notices a section in the JS read me which says the only
>>supported platform is Android. Can someone explain what is meant by this?
>> Not sure - where exactly are you seeing this?
>> > 2.) If it iOS JS changes are supported at this point where can we
>>find more documentation as to how to get things wired to the native side?
>> By the time 2.0 rolls around, plugin interfaces will probably change
>> for the better. I would go to
>> and look at some code
>> there. There is a general guide available at

View raw message