GDPR
General information
The General Data Protection Regulation (GDPR) came into effect in the spring of 2018. GDPR regulates how information about citizens of the European Economic Area and Switzerland can be collected and processed. Its intention is to protect the privacy of confidential data and to ensure the transparency of all processes related to the collection, storage and processing of information on the internet.
GDPR has extraterritorial reach and applies to all companies that process personal data of citizens of the European Economic Area and Switzerland, regardless of the company's location.
Quick guide
The user's consent to the processing of their personal data must be passed to the SDK with every app launch.
-
Follow these steps to connect the Mobile Ads SDK.
-
Show a window where the user can accept the user agreement for personal data processing (for more information, see the example).
This code is a sample, not a step-by-step guide to follow.
// ... // Example of creating a dialog window. func showGDPRDialog() { let alertController = UIAlertController( title: title, message: message, preferredStyle: .actionSheet) let acceptAction = UIAlertAction( title: "Accept", style: .default) { _ in self.setUserConsent(true) } alertController.addAction(acceptAction) let declineAction = UIAlertAction( title: "Decline", style: .default) { _ in self.setUserConsent(false) } alertController.addAction(declineAction) let openPrivacyPolicyAction = UIAlertAction( title: "View privacy policy", style: .default) { _ in UIApplication.shared.openURL(self.privacyPolicyURL) } alertController.addAction(openPrivacyPolicyAction) present(alertController, animated: true) } func setUserConsent(_ userConsent: Bool) { UserDefaults.standard.set(userConsent, forKey: kGDPRUserConsentKey) } func initializeAdsSDK() { let userConsent = UserDefaults.standard.bool(forKey: kGDPRUserConsentKey) YandexAds.setUserConsent(userConsent) } -
Use the
YandexAds.setUserConsent(_:)method to pass the received value to the Mobile Ads SDK. Data collected from users in GDPR countries is only processed with the user's consent.