Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit e0dfc2c

Browse files
committed
[[ Bug 20332 ]] Handle unset app id and set for user
This patch handles the case where the user has not yet set an app id and additionally offers to set the app id to a string that matches the chosen profile.
1 parent c81ae01 commit e0dfc2c

1 file changed

Lines changed: 42 additions & 3 deletions

File tree

Toolset/palettes/standalone settings/revstandalonesettingsiosbehavior.livecodescript

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,49 @@ on checkSettingsCompatible pName, pValue
427427
delete item 1 of tProfile["appid"]
428428

429429
local tID
430-
filter tAppID with tProfile["appid"] into tID
431-
if tID is empty then
432-
answer error revIDELocalise("The chosen provisioning profile requires an app ID matching:" && tProfile["appid"])
430+
if tAppID is empty then
431+
if tProfile["appid"] is "*" then
432+
-- do nothing as we are already default
433+
exit repeat
434+
end if
435+
else
436+
filter tAppID with tProfile["appid"] into tID
437+
if tID is not empty then
438+
-- already matches so do nothing
439+
exit repeat
440+
end if
433441
end if
442+
443+
if tProfile["appid"] contains "*" then
444+
repeat with tIndex = 1 to max(3, the number of items of tProfile["appid"])
445+
get item tIndex of tProfile["appid"]
446+
if it is empty or it is "*" then
447+
if tIndex > 3 then
448+
-- if we have a long wildcard just keep apending `id` for *
449+
put "id" into item tIndex of tID
450+
else
451+
put item tIndex of "com.yourcompany.yourapp" into item tIndex of tID
452+
end if
453+
else
454+
put it into item tIndex of tID
455+
end if
456+
end repeat
457+
else
458+
put tProfile["appid"] into tID
459+
end if
460+
461+
local tVars
462+
put tProfile["appid"] into tVars[1]
463+
put tID into tVars[2]
464+
465+
answer error revIDELocalise("The chosen provisioning profile requires an app ID matching %1" & return & return & \
466+
"Would you like to change to %2", tVars) with revIDELocalise("OK") or revIDELocalise("Cancel")
467+
468+
if it is "OK" then
469+
setSetting "ios,bundle id", tID
470+
put tID into field "Bundle Id"
471+
end if
472+
434473
exit repeat
435474
end if
436475
end repeat

0 commit comments

Comments
 (0)