App Tracking Transparency
Osano's SDK provides integration with Apple's App Tracking Transparency framework. This allows you to notify the Osano SDK of the user's tracking authorization status when the user makes a decision about tracking. The Osano SDK does not request tracking authorization on your behalf, you must do this in your app. If the user has already made a decision about tracking, the Osano SDK will already be aware of this, and you do not need to notify the SDK. In the event that the user has not made a decision about tracking, you should request tracking authorization and notify the Osano SDK of the user's decision. This will ensure that the Osano SDK is aware of the user's tracking authorization status the moment the user makes a decision.
If you do not notify the Osano SDK of the user's tracking authorization status immediately following the user's decision, the Osano SDK will not be aware of the user's decision until the next time the app is launched.
Usage
- Invoke the
AppTrackingTransparency
method to request tracking authorization from the user. - in the completion handler of the
AppTrackingTransparency
method, send a notification named"com.osano.OsanoConsentUpdate"
to the defaultNotificationCenter
with the user's tracking authorization status.
- Swift
- Objective-C
import AppTrackingTransparency
// ...
if #available(iOS 14, *) {
ATTrackingManager.requestTrackingAuthorization { status in
// Notify Osano SDK of the user's tracking authorization status
NotificationCenter.default.post(
name: Notification.Name("com.osano.OsanoConsentUpdate"), object: status)
}
}
#import <AppTrackingTransparency/AppTrackingTransparency.h>
if (@available(iOS 14, *)) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
// Notify Osano SDK of the user's tracking authorization status
[[NSNotificationCenter defaultCenter] postNotificationName:@"com.osano.OsanoConsentUpdate" object:@(status)];
}];
}