Data Privacy

The MobileFuse SDK supports privacy configurations that can be managed using an IAB compatible GPP Consent String, and US Privacy Strings. You can also tell the SDK whether your user is subject to COPPA, due to them being under 13 years of age.

The following snippet demonstrates configuration of a GPP String:

MobileFusePrivacyPreferences *privacyPreferences = [[MobileFusePrivacyPreferences alloc] init];
[privacyPreferences setGppConsentString:@"DBACNYA~CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA~1YNN"];

[MobileFuse setPrivacyPreferences:privacyPreferences];

The following snippet demonstrates configuration for the US privacy and COPPA compliance:

MobileFusePrivacyPreferences *privacyPreferences = [[MobileFusePrivacyPreferences alloc] init];
[privacyPreferences setSubjectToCoppa:NO]; // Shound be YES if user is under 13 years of age
[privacyPreferences setUsPrivacyConsentString:@"<US Privacy String>"]; // e.g. 1YNN

[MobileFuse setPrivacyPreferences:privacyPreferences];

The following snippet demonstrates setting the "do not track" option as an alternative to providing specific privacy strings:

MobileFusePrivacyPreferences *privacyPreferences = [[MobileFusePrivacyPreferences alloc] init];
[privacyPreferences setDoNotTrack:YES]; // With "do not track" set, the user is opted out!

[MobileFuse setPrivacyPreferences:privacyPreferences];
var privacyPreferences = MobileFusePrivacyPreferences()
privacyPreferences.setDoNotTrack(true) // With "do not track" set, the user is opted out!

MobileFuse.setPrivacyPreferences(privacyPreferences)

ℹ️

Note

To ensure that you get reliable ad fill and the best CPMs, please ensure that you implement the data privacy methods that are relevant to your user.

App Tracking Transparency Framework

You must also ensure that you have implemented the Apple App Tracking Transparency Framework into your app before any ad calls. This sample code shows how you can request the authorization. If authorization has already been granted, then the callback will immediately fire with the correct status, therefore it’s advisable to call the requestTrackingAuthorizationWithCompletionHandler method every time your app launches.

#import <AppTrackingTransparency/AppTrackingTransparency.h>

- (void)requestAppTracking {
    [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
        switch (status) {
            case ATTrackingManagerAuthorizationStatusNotDetermined:
            NSLog(@"ATT - Request not determined");
            break;
            case ATTrackingManagerAuthorizationStatusRestricted:
            NSLog(@"ATT - Request restricted");
            break;
            case ATTrackingManagerAuthorizationStatusDenied:
            NSLog(@"ATT - Request denied");
            break;
            case ATTrackingManagerAuthorizationStatusAuthorized:
            NSLog(@"ATT - Request authorized");
            break;
        }

        // Now we can request an ad!
        dispatch_async(dispatch_get_main_queue(), ^{
            [self loadAnAd];
        });
    }];
}