cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shazron <>
Subject Re: golang based plugins
Date Wed, 04 Jan 2017 01:24:53 GMT
I can only speak for iOS, but in the generated project code there is this
method you can override:

Parse what type of command there, and handle it. I suppose you could add a
prefix for the Service for GoLang plugin code to differentiate. If you
don't handle it, let Cordova handle it.

On Thu, Dec 29, 2016 at 1:17 PM, Ged Wed <> wrote:

> I am considered writing plugins  in golang ?
> I dont know enough about the internals of Cordova to estimate some of the
> work involved, and am looking for any feedback from others before writing
> this.
> The nature of the plugin API being so simple makes it very easy to be
> supported on obth Mobile and desktop.
> cordova.exec(function(winParam) {},
>              function(error) {},
>              "service",
>              "action",
>              ["firstArgument", "secondArgument", 42, false]);
> All that is needed is a pass through layer be written for IOS and android
> once, and never again.
> Once the pass through layr is written, all golang developers just write
> their plugins in golang.
> For Android a standard java layer passes the cordova.exec call to the
> golang binding.
> For IOS, its exactly same. an Objective C layer, that simple passes the
> cordova.exe call to the golang binding.
> At the golang level you just need to implement the same interface as
> cordova
> .exec
> Then the golang code  just does a switch on the Service and Action, and
> retusn the result.
> At this level you can use any golang embedded database (indexdb, bolt, etc)
> and any golang code pretty much.
> For the golang developer, compiling on mobile is always "gomobile build
> --target=android", which produces an android gradle project
> For IOS, its "gomobile build --target=ios", which produce a Framework
> project.
> For Desktop, its exactyl the same approach as for Mobile.
> Please let me knwo your thoughts
> thanks in advance ..
> Ged

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message