频道分类

DELPHI 获取Android package name:

作者:admin 来源: 日期:2019/4/11 11:50:09 人气: 标签:

 
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;