If your app participates in attribution, you should set the ATT (App Tracking Transparency) authorization waiting. During this time interval, the SDK will wait for the user to authorize ATT and obtain the IDFA before reporting the Install event, thereby increasing attribution accuracy. If the user has not authorized within the ATT authorization waiting interval, the SDK will still report the event, but the event will not include the IDFA.
Sample Code
#import <SolarEngineSDK/SolarEngineSDK.h>
SEConfig *config = [[SEConfig alloc] init];
config.attAuthorizationWaitingInterval = 120; // SDK waits for user authorization for up to 120 seconds.
[[SolarEngineSDK sharedInstance] startWithAppKey:appkey config:config];Note: An ATT authorization waiting period has been set. To request ATT authorization, the ATT authorization interface encapsulated by the SDK must also be used.
Warning: If the ATT authorization waiting is set and the ATT authorization interface of the SDK is not called, the installation event may be delayed by up to 120 seconds before being reported.
If the SDK's ATT authorization interface cannot be invoked
This interface applies for applications involved in attribution services on iOS devices.
The SolarEngine SDK encapsulates the iOS requestTrackingAuthorizationWithCompletionHandler method. By using the ATT authorization interface, the SDK can immediately know the user's authorization status. It can prioritize reporting Install events with IDFA and optimize attribution efficiency.
The "completion" callback value status corresponds to the iOS system's ATTrackingManagerAuthorizationStatus:
0: Not Determined 1: Restricted 2: Denied 3: Authorized 999: System error
- (void)requestTrackingAuthorizationWithCompletionHandler:(void (^)(NSUInteger status))completion;Sample Code
[[SolarEngineSDK sharedInstance] requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) {
switch (status) {
case 0:
NSLog(@"NotDetermined");
// ATTrackingManagerAuthorizationStatusNotDetermined case
break;
case 1:
NSLog(@"Restricted");
// ATTrackingManagerAuthorizationStatusRestricted case
break;
case 2:
NSLog(@"Denied");
// ATTrackingManagerAuthorizationStatusDenied case
break;
case 3:
NSLog(@"Authorized");
// ATTrackingManagerAuthorizationStatusAuthorized case
break;
case 999:
NSLog(@"systom error");
break;
}
}];