TrackingPermissionController
@objc(AASDKTrackingPermissionController)
@MainActor
public final class TrackingPermissionController : UIViewController
extension TrackingPermissionController: UIAdaptivePresentationControllerDelegate
A view controller subclass for a friendly IDFA tracking permission request.
-
The controller’s default title. This property is not used and cannot be changed.
Declaration
Swift
@MainActor final public override var title: String? { get set }
-
The controller’s default or custom configuration, which includes visual styling and content.
Declaration
Swift
@objc @MainActor public var configuration: TrackingPermissionConfiguration { get set }
-
The tracking permission delegate. Optional
Declaration
Swift
@objc @MainActor weak public var delegate: TrackingPermissionControllerDelegate?
-
Create a tracking permission controller with the default configuration and style.
Declaration
Swift
@MainActor public init(configuration: TrackingPermissionConfiguration? = nil)
Parameters
configuration
The preferred configuration of the controller. Optional.
-
Create a tracking permission controller with the default configuration and style.
Declaration
Swift
@MainActor public required init?(coder aDecoder: NSCoder)
-
Overridden by
TrackingPermissionController
.Declaration
Swift
@MainActor public override func viewDidLoad()
-
Overridden by
TrackingPermissionController
.Declaration
Swift
@MainActor public override func viewDidLayoutSubviews()
-
Overridden by
TrackingPermissionController
.Declaration
Swift
@MainActor public override var preferredStatusBarStyle: UIStatusBarStyle { get }
-
Overridden by
TrackingPermissionController
.Declaration
Swift
@MainActor public override var supportedInterfaceOrientations: UIInterfaceOrientationMask { get }
-
Overridden by
TrackingPermissionController
.Declaration
Swift
@MainActor public override var shouldAutorotate: Bool { get }
-
Dismiss the tracking permission controller.
Declaration
Swift
@MainActor public override func dismiss(animated: Bool = true, completion: (() -> Void)? = nil)
Parameters
animated
Whether to dismiss the alert animated.
completion
An optional closure that’s called when the dismiss finishes.
-
Returns
true
if either:- the tracking permission can be requested (has not been asked before)
- the current status is
denied
but you wish to make another attempt for the permission to be granted via Settings App -> Privacy. When the current status is alreadygranted
, this method will returnfalse
, as there is no need to go through the Tracking Permission flow. Note that, before any attempt to present an instance ofTrackingPermissionController
, you always need to make sure that this method returnstrue
.
Declaration
Swift
@MainActor public static func canPresentController() -> Bool
-
Convenience method to quickly create a tracking permission controller with basic customizations.
Declaration
Swift
@objc @MainActor public static func trackingController(title: String? = nil, message: String? = nil, contentImage: UIImage? = nil, headerImage: UIImage? = nil) -> TrackingPermissionController
Parameters
title
A custom title for the controller. It defaults to a generic title.
message
A custom message for the controller. It defaults to a generic description.
contentImage
A custom content image for the controller. It defaults to a generic image.
headerImage
A custom header image for the controller. Optional. Pass nil to remove it. By default, it is not shown.
Return Value
The controller with the designated configuration.
-
Overridden by
TrackingPermissionController
.Declaration
Swift
@MainActor public func presentationControllerDidDismiss(_ presentationController: UIPresentationController)