Skip to content

Commit

Permalink
get correct ID if multiple are used
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Sep 5, 2024
1 parent 07e54b8 commit e268ce4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Alloy/tiapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,19 @@ tiapp.getSdkVersion = function() {
tiapp.getBundleId = function() {
var elems = doc.documentElement.getElementsByTagName('id');
if (elems && elems.length > 0) {
return U.XML.getNodeText(elems.item(elems.length - 1));
var bundleId = U.XML.getNodeText(elems.item(elems.length - 1));
var isForced = false;
for (var i = 0; i < elems.length; i++) {
if (elems.item(i).getAttribute("platform") === "android") {

Check failure on line 49 in Alloy/tiapp.js

View workflow job for this annotation

GitHub Actions / Lint

Strings must use singlequote

Check failure on line 49 in Alloy/tiapp.js

View workflow job for this annotation

GitHub Actions / Lint

Strings must use singlequote

Check failure on line 49 in Alloy/tiapp.js

View workflow job for this annotation

GitHub Actions / Lint

Strings must use singlequote

Check failure on line 49 in Alloy/tiapp.js

View workflow job for this annotation

GitHub Actions / Lint

Strings must use singlequote
// platform specific ID
isForced = true;
bundleId = U.XML.getNodeText(elems.item(i));
} else if (elems.item(i).getAttribute("platform") === "" && !isForced) {

Check failure on line 53 in Alloy/tiapp.js

View workflow job for this annotation

GitHub Actions / Lint

Strings must use singlequote

Check failure on line 53 in Alloy/tiapp.js

View workflow job for this annotation

GitHub Actions / Lint

Strings must use singlequote

Check failure on line 53 in Alloy/tiapp.js

View workflow job for this annotation

GitHub Actions / Lint

Strings must use singlequote

Check failure on line 53 in Alloy/tiapp.js

View workflow job for this annotation

GitHub Actions / Lint

Strings must use singlequote
// normal ID - only if no platform specific was set already
bundleId = U.XML.getNodeText(elems.item(i));
}
}
return bundleId;
}
};
function getSdkSelectVersion() {
Expand Down

0 comments on commit e268ce4

Please sign in to comment.