PersonalInfoManager /5.0.0

public class PersonalInfoManager

Contains GDPR-related methods that include checking consent status if GDPR applies, and for manually granting or revoking consent. Refer to our GDPR documentation for additional usage instructions.

Public Methods

public final boolean /canCollectPersonalInformation() /+5.0.0

  • Description: Returns whether the SDK is allowed to collect user-identifiable data. Returns true if it is allowed or when GDPR does not apply; false otherwise.

  • Parameters: None.

public void /forceGdprApplies() /+5.1.0

  • Description: Forces the SDK to treat this app as in a GDPR-applicable region. Setting this will permanently force GDPR rules for this user unless this app is uninstalled or the data for this app is cleared.

  • Parameters: None.

public Boolean /gdprApplies() /+5.0.0

  • Description: Returns whether the SDK thinks the user is in a GDPR-applicable region. Returns true for in a GDPR region; false for not in a GDPR region, and null for unknown. This value can be overwritten to true by setting forceGdprApplies(). Returns true for in a GDPR region; false for not in a GDPR region, and null for unknown.

  • Parameters: None.

public ConsentData /getConsentData() /+5.0.0

  • Description: Returns ConsentData, a snapshot of the underlying data store. Intended for use by allowlisted publishers only. Gets a copy of the current and consented vendor list and privacy policy and their versions.

  • Parameters: None.

public ConsentStatus /getPersonalInfoConsentStatus() /+5.0.0

  • Description: Returns ConsentStatus representing the user’s current consent status. In general, publishers should not query this directly. Instead, use canCollectPersonalInformation.

  • Parameters: None.

public void /grantConsent() /+5.0.0

  • Description: For use by allowlisted publishers only. Grants consent to collect personally identifiable information for the current user.

  • Parameters: None.

public boolean /isConsentDialogReady() /+5.0.0

  • Description: Whether the consent dialog is done loading and is ready to show. Returns true if yes; false otherwise.

  • Parameters: None.

public void /loadConsentDialog(ConsentDialogListener consentDialogListener) /+5.0.0

  • Description: Issues a request to load the MoPub consent dialog.

  • Parameters:

    • consentDialogListener: This callback is issued when the dialog has finished loading or has failed to load.

public void /requestSync(boolean force) /+5.0.0

  • Description: Called internally to request a sync to the ad server about consent status and other metadata.

  • Parameters:

    • force: Call sync even if mSyncDelayMs has not been reached. Sync will not occur if user is not in a GDPR region or if a request is already in flight.

public void /revokeConsent() /+5.0.0

  • Description: Denies consent to collect personally identifiable information for the current user.

  • Parameters: None.

public void /setAllowLegitimateInterest(boolean allowed) /+5.5.0

  • Description: Set the allowance of legitimate interest.

  • Parameters:

    • allowed: true if legitimate interest is allowed; false otherwise.

public boolean /shouldAllowLegitimateInterest() /+5.5.0

  • Description: Checks if legitimate interest is allowed. Returns true if legitimate interest is allowed; false otherwise.

  • Parameters: None.

public boolean /shouldShowConsentDialog() /+5.0.0

  • Description: Checks to see if a publisher should load and then show a consent dialog. Returns true if consent dialog should be loaded; false otherwise.

  • Parameters: None.

public boolean /showConsentDialog() /+5.0.0

  • Description: If the MoPub consent dialog is loaded, then shows it. Returns true if the consent dialog is ready to be shown; false otherwise.

  • Parameters: None.

public void /subscribeConsentStatusChangeListener(ConsentStatusChangeListener consentStatusChangeListener) /+5.0.0

  • Description: Adds a listener for consent status changes.

  • Parameters:

    • consentStatusChangeListener: The nConsentStateChange(@NonNull final ConsentStatus oldConsentStatus, @NonNull final ConsentStatus newConsentStatus, boolean canCollectPersonalInformation) callback that exposes the previous consent status, the new consent status, and whether personal information can still be collected

public void /unsubscribeConsentStatusChangeListener(ConsentStatusChangeListener consentStatusChangeListener) /+5.0.0

  • Description: Unsubscribes a consentStatusChangeListener.

  • Parameters:

    • consentStatusChangeListener: The nConsentStateChange(@NonNull final ConsentStatus oldConsentStatus, @NonNull final ConsentStatus newConsentStatus, boolean canCollectPersonalInformation) callback that exposes the previous consent status, the new consent status, and whether personal information can still be collected.

Last updated July 11, 2020

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2020 MoPub (a division of Twitter, Inc.)