Reputation: 1299
Is there a way to get the application id in runtime for Android and iOS in delphi XE7?
For android you can see the application id at: project options -> version info(Target Android) -> package and for iOS: project options -> version info(Target iOS) -> CFBundleName
Thanks in advance!
Upvotes: 2
Views: 2976
Reputation: 28517
Reading Android package name:
uses
Androidapi.Helpers;
function PackageName: string;
begin
Result := JStringToString(SharedActivityContext.getPackageName);
end;
Reading iOS bundle name:
uses
Macapi.CoreFoundation, iOSApi.Foundation;
function PackageName: string;
begin
Result := TNSString.Wrap(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle, kCFBundleIdentifierKey)).UTF8String;
end;
Upvotes: 4