For iOS, there is a version method available in native code as well: https://github.com/callback/callback-ios/blob/master/PhoneGapLib/Classes/PhoneGapDelegate.m#L149-170
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 <[email protected]> wrote: > On Thu, Nov 17, 2011 at 13:05, Jesse MacFadyen <[email protected]>wrote: > >> Runtime js code can look at device.phonegap for the version. >> >> http://docs.phonegap.com/en/1.2.0/phonegap_device_device.md.html#device.phonegap > > > 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 > http://muellerware.org >
