diff --git a/umpexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/umpimaapp/ConsentManager.java b/umpexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/umpimaapp/ConsentManager.java index 577f5f8..935f87e 100644 --- a/umpexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/umpimaapp/ConsentManager.java +++ b/umpexample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/umpimaapp/ConsentManager.java @@ -68,16 +68,30 @@ public void gatherConsent(OnConsentGatheringCompleteListener onConsentGatheringC .setConsentDebugSettings(debugSettings) .build(); - // [START gather_consent] + // [START request_consent_info_update] // Requesting an update to consent information should be called on every app launch. consentInformation.requestConsentInfoUpdate( activity, params, - () -> + () -> // Called when consent information is successfully updated. + // [START_EXCLUDE] + // [START load_and_show_consent_form] UserMessagingPlatform.loadAndShowConsentFormIfRequired( - activity, onConsentGatheringCompleteListener::consentGatheringComplete), - onConsentGatheringCompleteListener::consentGatheringComplete); - // [END gather_consent] + activity, + formError -> { + // Consent gathering process has completed. + // [START_EXCLUDE] + onConsentGatheringCompleteListener.consentGatheringComplete(formError); + // [END_EXCLUDE] + }) + // [END load_and_show_consent_form] + // [END_EXCLUDE] + , + requestConsentError -> // Called when there's an error updating consent information. + // [START_EXCLUDE] + onConsentGatheringCompleteListener.consentGatheringComplete(requestConsentError)); + // [END_EXCLUDE] + // [END request_consent_info_update] } /** Shows a form to app users for collecting their consent. */