Hi,
I have been using the App Tracking Transparency request in an app successfully for past 3 years. Was trying to update the app and noticed that the ATT does not work in iOS 18. Actually, it works ok in the debug version but not in the compiled version (B4i ver 8.50) - it does not show up on an new install. Here is what I am using-
Appreciate any suggestions. Thanks.
I have been using the App Tracking Transparency request in an app successfully for past 3 years. Was trying to update the app and noticed that the ATT does not work in iOS 18. Actually, it works ok in the debug version but not in the compiled version (B4i ver 8.50) - it does not show up on an new install. Here is what I am using-
B4X:
#AdditionalLib: AppTrackingTransparency.framework
#PlistExtra: <key>SKAdNetworkItems</key><array><dict><key>SKAdNetworkIdentifier</key><string>cstr6suwn9.skadnetwork</string></dict></array>
#PlistExtra: <key>NSUserTrackingUsageDescription</key>
#PListExtra: <string>This identifier will be used To deliver personalized ads To you.</string>
B4X:
Dim no As NativeObject = Me
no.RunMethod("requestIDFA", Null)
Wait For GAD_TrackingAuthorization (Status As Int)
'Status = 3 means that the user allowed your app access to the tracking id
Log("GAD_TrackingAuthorization status=" & Status)
B4X:
#if OBJC
#import <AppTrackingTransparency/AppTrackingTransparency.h>
#import <AdSupport/AdSupport.h>
- (void)requestIDFA {
if (@available(iOS 14, *)) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
[self.bi raiseUIEvent:nil event:@"gad_trackingauthorization:" params:@[@(status)]];
}];
} else {
[self.bi raiseUIEvent:nil event:@"gad_trackingauthorization:" params:@[@(3)]];
}
}
#End If