Use the new beta privacy APIs
Implement the new beta privacy APIs by following the opt-in consent, opt-out signal, and age-restricted user specification APIs, respectively, for iOS (Swift, Objective-C) and Android (Kotlin, Java) development.
읽는 시간 2분최근 업데이트: 5달 전
Use the new beta privacy APIs
Review the opt-in consent, opt-out signal, and age-restricted specification APIs and relevant code samples for iOS or Android.
Opt-in consent API
Use the API to display the user's opt-in choices for personalized ads.
setUserConsent()Refer to the following tabs for platform-specific code examples to communicate whether the user has granted or declined consent for targeted advertising.
public static func setUserConsent(_ consentGranted: Bool)// If the user agrees to personalized adsUnityAds.setUserConsent(true)// If the user doesn't agree to personalized adsUnityAds.setUserConsent(false)
Opt-out signal API
Use the API to display the user's opt-in choices for personalized ads.
setUserOptOut()Refer to the following tabs for platform-specific code examples to communicate whether the user has granted or declined consent for targeted advertising.
public static func setUserOptOut(_ optOut: Bool)// If the user opts in to personalized adsUnityAds.setUserOptOut(false)// If the user opts out to personalized adsUnityAds.setUserOptOut(true)
Age-restricted users specification
Use the API to indicate a user's eligibility for non-behavioral (contextual) ads.
setNonBehavioral()Refer to the following tabs for platform-specific code examples to communicate whether a privacy framework requires contextual-only ad delivery, typically for content directed to children or younger users.
public static func setNonBehavioral(_ nonBehavioral: Bool)// If the user opts out to personalized adsUnityAds.setNonBehavioral(true)// If the user opts in to personalized adsUnityAds.setNonBehavioral(false)