I am using Delphi 11 and need to get my app version number built in IOS. How to do it? In Android is easy but IOS I cannot find info.
Regards,
Thiago.
I am using Delphi 11 and need to get my app version number built in IOS. How to do it? In Android is easy but IOS I cannot find info.
Regards,
Thiago.
This is one way:
uses
Macapi.Helpers,
iOSapi.Foundation;
function GetAppVersion: string;
var
LValueObject: Pointer;
begin
Result := '';
LValueObject := TNSBundle.Wrap(TNSBundle.OCClass.mainBundle).infoDictionary.objectForKey(StringToID('CFBundleVersion'));
if LValueObject <> nil then
Result := NSStrToStr(TNSString.Wrap(LValueObject));
end;
Note that in some cases you may wish to retrieve the value for CFBundleShortVersionString
instead of CFBundleVersion
.