MoPubConsent /5.8.0

public class MoPubConsent : MonoBehaviour

Object that manages the GDPR consent state and dialog.

Public Properties

public ConsentStatusChangedEvent /ConsentStatusChanged /+5.8.0

  • Description: Allows setting of this callback to a listener method on the MoPub Manager Prefab Inspector panel. Callback indicates that the consent status has been changed.

public ConsentDialogLoadedEvent /ConsentDialogLoaded /+5.8.0

  • Description: Allows setting of this callback to a listener method on the MoPub Manager Prefab Inspector panel. Callback indicates that the consent dialog has been loaded (but not shown yet).

public ConsentDialogFailedEvent /ConsentDialogFailed /+5.8.0

  • Description: Allows setting of this callback to a listener method on the MoPub Manager Prefab Inspector panel. Callback indicates that the consent dialog load has failed.

public ConsentDialogShownEvent /ConsentDialogShown /+5.8.0

  • Description: Allows setting of this callback to a listener method on the MoPub Manager Prefab Inspector panel. Callback indicates that the consent dialog has been successfully shown.

public ConsentDialogDismissedEvent /ConsentDialogDismissed /+5.8.0

  • Description: Allows setting of this callback to a listener method on the MoPub Manager Prefab Inspector panel. Callback indicates that the consent dialog has been dismissed.

public bool /AutoShowConsentDialog /+5.8.0

  • Description: Used by MoPub Manager Prefab. Allows this option to be available on the Inspector panel. If this is set to true, MoPub Manager will handle loading and showing the GDPR consent dialog automatically.

public string /LocationAwarenessUsage /+5.8.0

  • Description: Used by MoPub Manager Prefab. Allows this option to be available on the Inspector panel. Indicates the reason that your app needs to be location aware. Required for App Store acceptance. iOS Only.

public const string /DefaultLocationAwarenessUsage /+5.8.0

  • Description: Message to inform users of location awareness. iOS Only.

public static string /LocationAwarenessUsageDescription /+5.8.0

  • Description: Getter of LocationAwarenessUsage. Returns DefaultLocationAwarenessUsage if LocationAwarenessUsage is null or cannot be retrieved properly. iOS Only.

public static bool? /IsGdprApplicable /+5.8.0

  • Description: Flag indicating whether data collection is subject to GDPR. Returns true if subject to GDPR; false if not; and null if unknown (from startup until server responds during SDK initialization).

public static MoPub.Consent.Status /CurrentConsentStatus /+5.8.0

  • Description: The user’s current consent state for the app to collect personally identifiable information (PII). Refer to MoPub.Consent.Status for the values and their meanings.

public static bool /CanCollectPersonalInfo /+5.8.0

  • Description: Whether or not this app is allowed to collect personally identifiable information (PII) from the user.

public static bool /ShouldShowConsentDialog /+5.8.0

  • Description: Checks to see if a publisher should load and then show a consent dialog.

public static bool /IsConsentDialogReady /+5.8.0

  • Description: Flag indicating whether the MoPub consent dialog is currently loaded and showable.

Public Subclasses

[Serializable] public class /ConsentStatusChangedEvent : UnityEvent<MoPub.Consent.Status, MoPub.Consent.Status, bool> /+5.8.0

  • Description: Used by MoPub Manager Prefab. Routes the consent-related event that is called when the consent status has been changed.

[Serializable] public class /ConsentDialogLoadedEvent : UnityEvent /+5.8.0

  • Description: Used by MoPub Manager Prefab. Allows this option to be available on the Inspector panel. Routes the consent-dialog-related event that is called when the consent dialog has been loaded (but not shown yet).

[Serializable] public class /ConsentDialogFailedEvent : UnityEvent<string> /+5.8.0

  • Description: Used by MoPub Manager Prefab. Allows this option to be available on the Inspector panel. Routes the consent-dialog-related event that is called when the consent dialog load has failed.

[Serializable] public class /ConsentDialogShownEvent : UnityEvent /+5.8.0

  • Description: Used by MoPub Manager Prefab. Allows this option to be available on the Inspector panel. Routes the consent-dialog-related event that is called when the consent dialog has been successfully shown.

[Serializable] public class /ConsentDialogDismissedEvent : UnityEvent /+5.8.0

  • Description: Used by MoPub Manager Prefab. Allows this option to be available on the Inspector panel. Routes the consent-dialog-related event that is called when the consent dialog has been dismissed.

Public Methods

public static void /LoadConsentDialog() /+5.0.0

  • Description: Loads the consent dialog.

  • Parameters: None.

public static void /ShowConsentDialog() /+5.8.0

  • Description: Attempts to show the loaded consent dialog.

  • Parameters: None.

Last updated July 22, 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.)