forked from FMXExpress/ios-object-pascal-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iOSapi.AdSupport.pas
82 lines (59 loc) · 1.62 KB
/
iOSapi.AdSupport.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{ *********************************************************** }
{ }
{ CodeGear Delphi Runtime Library }
{ }
{ Copyright(c) 2012-2014 Embarcadero Technologies, Inc. }
{ }
{ *********************************************************** }
//
// Delphi-Objective-C Bridge
// Interfaces for Cocoa framework AdSupport
//
unit iOSapi.AdSupport;
interface
uses
Macapi.CoreFoundation,
Macapi.CoreServices,
Macapi.Dispatch,
Macapi.Foundation,
Macapi.Mach,
Macapi.ObjCRuntime,
Macapi.ObjectiveC,
Macapi.QuartzCore,
iOSapi.CocoaTypes,
iOSapi.Foundation;
type
// ===== Forward declarations =====
{$M+}
ASIdentifierManager = interface;
// ===== Interface declarations =====
ASIdentifierManagerClass = interface(NSObjectClass)
['{7FDE511A-AD7C-4218-A85C-AA4A3B45913B}']
{ class } function sharedManager: ASIdentifierManager; cdecl;
end;
ASIdentifierManager = interface(NSObject)
['{DF6B7B58-B8A4-4672-9552-C61786F0DAAE}']
function advertisingIdentifier: NSUUID; cdecl;
function isAdvertisingTrackingEnabled: Boolean; cdecl;
end;
TASIdentifierManager = class(TOCGenericImport<ASIdentifierManagerClass,
ASIdentifierManager>)
end;
PASIdentifierManager = Pointer;
// ===== External functions =====
const
libAdSupport = '/System/Library/Frameworks/AdSupport.framework/AdSupport';
implementation
{$IF defined(IOS) and NOT defined(CPUARM)}
uses
Posix.Dlfcn;
var
AdSupportModule: THandle;
{$ENDIF IOS}
{$IF defined(IOS) and NOT defined(CPUARM)}
initialization
AdSupportModule := dlopen(MarshaledAString(libAdSupport), RTLD_LAZY);
finalization
dlclose(AdSupportModule);
{$ENDIF IOS}
end.