incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shazron <>
Subject Re: Callback version available in platform natives and JS
Date Thu, 17 Nov 2011 19:17:09 GMT
For iOS, there is a version method available in native code as well:

Only a runtime approach - so from a plugin, you would call:
NSString* pgVersion = [PhoneGapDelegate phoneGapVersion];

There are currently two ways that the library gets the version - one
is through a build preprocessor macro (this is for PhoneGap.framework,
version is baked in), one from reading from the VERSION file (legacy
code - mainly for Xcode 3 based projects).

On Thu, Nov 17, 2011 at 11:10 AM, Patrick Mueller <> wrote:
> On Thu, Nov 17, 2011 at 13:05, Jesse MacFadyen <>wrote:
>> Runtime js code can look at device.phonegap for the version.
> ah, didn't see that.  Not clear what's being returned here, presumably a
> string like "1.2.0".  We may want to make it more elaborate, like
> separating out major/minor/fix numbers or something, depending on what we
> do in the native side.
>> For build-time I like the #define approach, but this can vary by platform.
> Right.  For Java-based platforms, presumably we'd have final static
> Thing(s) with the version #'s; for C-based platforms, preprocessor defines
> make more sense.  We can evaluate a couple of different styles of these if
> we want to move forward on it.
> --
> Patrick Mueller

View raw message