forked from EddyVerbruggen/nativescript-appversion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappversion.ios.js
executable file
·44 lines (39 loc) · 1.17 KB
/
appversion.ios.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
exports.getAppId = function() {
return new Promise(function(resolve, reject) {
try {
resolve(NSBundle.mainBundle.bundleIdentifier);
} catch (ex) {
console.log("Error in appversion.getAppId: " + ex);
reject(ex);
}
});
};
exports.getAppIdSync = function() {
return NSBundle.mainBundle.bundleIdentifier;
};
exports.getVersionName = function() {
return new Promise(function(resolve, reject) {
try {
resolve(NSBundle.mainBundle.infoDictionary.objectForKey("CFBundleShortVersionString"));
} catch (ex) {
console.log("Error in appversion.getVersionName: " + ex);
reject(ex);
}
});
};
exports.getVersionNameSync = function() {
return NSBundle.mainBundle.infoDictionary.objectForKey("CFBundleShortVersionString");
};
exports.getVersionCode = function() {
return new Promise(function(resolve, reject) {
try {
resolve(NSBundle.mainBundle.infoDictionary.objectForKey("CFBundleVersion"));
} catch (ex) {
console.log("Error in appversion.getVersionCode: " + ex);
reject(ex);
}
});
};
exports.getVersionCodeSync = function() {
return NSBundle.mainBundle.infoDictionary.objectForKey("CFBundleVersion");
};