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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// The object that contains the advertising identifier.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/adsupport/asidentifiermanager?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct ASIdentifierManager;
);
extern_conformance!(
unsafe impl NSObjectProtocol for ASIdentifierManager {}
);
impl ASIdentifierManager {
extern_methods!(
/// The shared instance of the identifier manager class.
///
/// - Returns: Returns the shared instance of the AdSupport identifier manager
/// class.
#[unsafe(method(sharedManager))]
#[unsafe(method_family = none)]
pub unsafe fn sharedManager() -> Retained<ASIdentifierManager>;
/// The UUID that is specific to a device.
///
/// The ``ASIdentifierManager/advertisingIdentifier`` is an alphanumeric string
/// that’s unique to each device, and which you only use for advertising. Use
/// this string for frequency capping, attribution, conversion events,
/// estimating the number of unique users, advertising fraud detection, and
/// debugging. On devices running iOS 14.5 and later and iPadOS 14.5 and later,
/// your app must request tracking authorization before it can get the
/// advertising identifier. For more information on getting the advertising
/// identifier, see ``AdSupport``.
///
/// The advertising identifier returns either a unique UUID, or all zeros. It
/// returns a unique UUID in the following cases:
///
/// - If Settings
/// >
/// Privacy
/// >
/// Tracking
/// >
/// Allow Apps to Request to Track
/// is On, you’ve requested tracking authorization from the user by calling the
/// <doc
/// ://com.apple.documentation/documentation/apptrackingtransparency> APIs,
/// and received authorization, indicated by
/// <doc
/// ://com.apple.documentation/documentation/apptrackingtransparency/attrackingmanager/authorizationstatus/authorized>.
/// - If the user changes Settings
/// >
/// Privacy
/// >
/// Tracking
/// >
/// Allow Apps to
/// Request to Track to Off after authorizing your app, and leaves the
/// permissions On for your app.
///
/// The advertising identifier returns all zeros
/// (`00000000-0000-0000-0000-000000000000`) in the following cases:
///
/// - In Simulator, regardless of any settings.
/// - When you call this API on a device running macOS.
/// - When you call this API in a compatible iPad or iPhone app running in visionOS.
/// - On devices running iOS 14.5 and later and iPadOS 14.5 and later, if you haven’t requested authorization using the
/// <doc
/// ://com.apple.documentation/documentation/apptrackingtransparency> framework.
/// - If you’ve requested authorization using the
/// <doc
/// ://com.apple.documentation/documentation/apptrackingtransparency> framework and the user declines, which results in an authorization status of
/// <doc
/// ://com.apple.documentation/documentation/apptrackingtransparency/attrackingmanager/authorizationstatus/denied>.
/// - When a profile or configuration restricts access to the advertising identifier. For more information about restrictions, see
/// <doc
/// ://com.apple.documentation/documentation/apptrackingtransparency/attrackingmanager/authorizationstatus/restricted>.
///
/// As a best practice, don’t store the advertising identifier value; access
/// ``ASIdentifierManager/advertisingIdentifier`` instead. Users can change
/// their authorization for tracking at any time in Settings
/// >
/// Privacy
/// >
/// Tracking. Check your app’s authorization using the App Tracking Transparency
/// API
/// <doc
/// ://com.apple.documentation/documentation/apptrackingtransparency/attrackingmanager/3547038-trackingauthorizationstatus>
/// to determine the user’s intent.
///
/// For more information about asking users for permission to track, see [User
/// Privacy and Data
/// Use](https://developer.apple.com/app-store/user-privacy-and-data-use/).
#[unsafe(method(advertisingIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn advertisingIdentifier(&self) -> Retained<NSUUID>;
/// A Boolean value that indicates whether the user has limited ad tracking
/// enabled.
///
/// - Warning: This property is deprecated. Functionality has been replaced by
/// the
/// <doc
/// ://com.apple.documentation/documentation/apptrackingtransparency>
/// framework.
#[deprecated = "This has been replaced by functionality in AppTrackingTransparency's ATTrackingManager class."]
#[unsafe(method(isAdvertisingTrackingEnabled))]
#[unsafe(method_family = none)]
pub unsafe fn isAdvertisingTrackingEnabled(&self) -> bool;
);
}
/// Methods declared on superclass `NSObject`.
impl ASIdentifierManager {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}