private void UpdateConsentValues() { _canCollectPersonalInfo = MoPub.CanCollectPersonalInfo; _currentConsentStatus = MoPub.CurrentConsentStatus; _shouldShowConsentDialog = MoPub.ShouldShowConsentDialog; _isGdprApplicable = MoPub.IsGdprApplicable; }
public void UpdateConsentValues() { bool canCollect = PlayerPrefs.HasKey("privateState"); if (canCollect) { canCollect = (PlayerPrefs.GetString("privateState") == "1"); } //MoPub.CanCollectPersonalInfo = canCollect; if (canCollect) { MoPubAndroid.PartnerApi.GrantConsent(); //MoPub.CurrentConsentStatus = MoPubBase.Consent.Status.Consented; } else { MoPubAndroid.PartnerApi.RevokeConsent(); //MoPub.CurrentConsentStatus = MoPubBase.Consent.Status.Denied; } _canCollectPersonalInfo = MoPub.CanCollectPersonalInfo; _currentConsentStatus = MoPub.CurrentConsentStatus; _shouldShowConsentDialog = MoPub.ShouldShowConsentDialog; _isGdprApplicable = MoPub.IsGdprApplicable; }
public void ConsentStatusChanged(MoPub.Consent.Status oldStatus, MoPub.Consent.Status newStatus, bool canCollectPersonalInfo) { _canCollectPersonalInfo = canCollectPersonalInfo; _currentConsentStatus = newStatus; _shouldShowConsentDialog = MoPub.ShouldShowConsentDialog; UpdateStatusLabel($"Consent status changed from {oldStatus} to {newStatus}"); }
// Forward from the C# events to the unity events. private void fwdConsentStatusChanged(MoPub.Consent.Status oldConsent, MoPub.Consent.Status newConsent, bool canCollectPersonalInfo) { if (ConsentStatusChanged != null) { ConsentStatusChanged.Invoke(oldConsent, newConsent, canCollectPersonalInfo); } ShowConsentDialogIfNeeded(); }
// Forward from the C# events to the unity events. private void fwdConsentStatusChanged(MoPub.Consent.Status oldConsent, MoPub.Consent.Status newConsent, bool canCollectPersonalInfo) { if (ConsentStatusChanged != null) { ConsentStatusChanged.Invoke(oldConsent, newConsent, canCollectPersonalInfo); } if (AutoShowConsentDialog && ShouldShowConsentDialog) { if (IsConsentDialogReady) // Already loaded? { ShowConsentDialog(); } else { LoadConsentDialog(); } } }
public void SetShouldShowConsentDialog(bool isGdprApplicable) { // HACK for testing purposes only. Use it to reinitialize an unknown consent state, or to skip the consent dialog. _isGdprApplicable = isGdprApplicable; _currentConsentStatus = isGdprApplicable ? MoPub.Consent.Status.Unknown : MoPub.Consent.Status.Consented; }
private void OnConsentStatusChangedEvent(MoPub.Consent.Status oldStatus, MoPub.Consent.Status newStatus, bool canCollectPersonalInfo) { _demoGUI.ConsentStatusChanged(newStatus, canCollectPersonalInfo); }
private void OnConsentStatusChangedEvent(MoPub.Consent.Status oldStatus, MoPub.Consent.Status newStatus, bool canCollectPersonalInfo) { Debug.Log("OnConsetStatusChangedEvent: old=" + oldStatus + " new=" + newStatus + " personalInfoOk=" + canCollectPersonalInfo); _demoGUI.ConsentStatusChanged(newStatus, canCollectPersonalInfo); }