Bundle
Bundle
The bundle object is a global object giving access to informations about the app, JavaScript API, and OS version.
Available in Paw JavaScript API version 0.2.0 and later.
appId
appId
The application unique identifier. Currently, it’s always com.luckymarmot.Paw
appVersion
appVersion
The application version number (e.g. 2.3).
appBuild
appBuild
The application build number (e.g. 2002003005).
osVersion
osVersion
The operating system version (e.g. 10.10.5).
minApiVersion
minApiVersion
Argument: version: string: None
Api version string
Returns: None: boolean
Returns true
if JavaScript API is at least the specified version.
if (bundle.minApiVersion('0.2.0')) {
console.log('Is at least 0.2.0');
}
else {
console.log('Running a legacy version. Not supported.');
}
versionCompare
versionCompare
Argument: version_a: string: None
Api version string
Argument: version_b: string: None
Api version string
Returns:
None: integer
1
if version_a < version_b
0
if version_a == version_b
-1
if version_a > version_b
Compares two version numbers can be used to sort a list of verstion numbers.
var versions = ['0.1.0', '0.2.0', '0.1.1'];
versions.sort(bundle.versionCompare);
console.log(versions.join(',')); // 0.1.0,0.1.1,0.2.0