Consent for Cocoa apps
Zoho Apptics provides solutions for setting the tracking state by showing the consent alert to your user.
Apptics in-built privacy consent
- Use the below method to show the privacy consent to the users.
Copied+ (void) showPrivacyConsent;
- Before calling the above method, make sure to check the current privacy status using the below method.
CopiedAPPrivacyStatus status = [Apptics getPrivacyStatus];
- If the status is APPrivacyStatusUnknown, you should proceed to show the user consent.
In-built privacy settings
- Show the Analytics settings view to the user to manage their analytics settings.
Copied+ (void) openAnalyticSettingsController;
- You can customize the analytics settings UI using APTheme, APSettingTheme, and APUserConsentTheme classes.
Custom privacy settings
To customize the privacy settings interface as per your app, add three buttons to your settings screen.
Tracking status - You can check and set the tracking status using the below method.
Copied[Apptics setTrackingStatus:YES/NO];
Crash report status - You can enable or disable the crash reports by using the below method.
Copied[Apptics setCrashReportStatus:YES/NO];
Personal info tracking - You can set the status for user ID in analytics using the below method.
Copied[Apptics setPersonalInfoTrackingStatus:YES/NO];
- If the crash reporting is disabled and the app crashes, an alert will be shown to the users.
AppTracking transparency on iOS14+
From iOS 14.5 onwards, you must ask for user's permission to track them using AppTrackingTransparency framework. It is recommended to show an explainer screen before presenting the permission dialog to provide context on how the tracked data will be used.
Once the user agrees and continues to use the app, call the following method to request tracking authorization.
Copied[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
switch (status) {
case ATTrackingManagerAuthorizationStatusAuthorized:
// User allowed tracking
[Apptics setPersonalInfoTrackingStatus:YES];
break;
default:
// User denied tracking
[Apptics setPersonalInfoTrackingStatus:NO];
break;
}
}];
Copiedif NSClassFromString("ATTrackingManager") == nil {
ATTrackingManager.requestTrackingAuthorization { status in
// Check for status after request
switch status {
case .authorized:
// The user authorizes access to app-related data that can be used for tracking the user or the device.
// Set personal info tracking status true when the user accepts.
Apptics.setPersonalInfoTrackingStatus(true)
case _:
// Set personal info tracking status false when the user rejected.
Apptics.setPersonalInfoTrackingStatus(false)
}
}
}
Important configuration
- Add the Privacy - Tracking Usage Description key to your info.plist file.
- Include the AppTrackingTransparency.framework in your app's target.
- Import AppTrackingTranparency in your code.
Note: The user settings for 'include userID / track anonymously' will apply to both crash and usage stats.