Search in sources :

Example 6 with PersonalInfoManager

use of com.mopub.common.privacy.PersonalInfoManager in project mopub-android-mediation by mopub.

the class TapjoyInterstitial method fetchMoPubGDPRSettings.

// Pass the user consent from the MoPub SDK to Tapjoy as per GDPR
private void fetchMoPubGDPRSettings() {
    PersonalInfoManager personalInfoManager = MoPub.getPersonalInformationManager();
    if (personalInfoManager != null) {
        Boolean gdprApplies = personalInfoManager.gdprApplies();
        if (gdprApplies != null) {
            tjPrivacyPolicy.setSubjectToGDPR(gdprApplies);
            if (gdprApplies) {
                String userConsented = MoPub.canCollectPersonalInformation() ? "1" : "0";
                tjPrivacyPolicy.setUserConsent(userConsented);
            } else {
                tjPrivacyPolicy.setUserConsent("-1");
            }
        }
    }
}
Also used : PersonalInfoManager(com.mopub.common.privacy.PersonalInfoManager)

Example 7 with PersonalInfoManager

use of com.mopub.common.privacy.PersonalInfoManager in project mopub-android-mediation by mopub.

the class OguryRewardedVideo method load.

@Override
protected void load(@NonNull Context context, @NonNull AdData adData) {
    Preconditions.checkNotNull(context);
    Preconditions.checkNotNull(adData);
    final PersonalInfoManager personalInfoManager = MoPub.getPersonalInformationManager();
    if (personalInfoManager != null) {
        final boolean consentIsUnknown = personalInfoManager.getPersonalInfoConsentStatus() == ConsentStatus.UNKNOWN;
        final boolean canCollectPersonalInfo = MoPub.canCollectPersonalInformation();
        if (OguryAdapterConfiguration.initialized() && !consentIsUnknown) {
            OguryChoiceManagerExternal.setConsent(canCollectPersonalInfo, OguryAdapterConfiguration.CHOICE_MANAGER_CONSENT_ORIGIN);
        }
    }
    setAutomaticImpressionAndClickTracking(false);
    final Map<String, String> extras = adData.getExtras();
    mAdUnitId = OguryAdapterConfiguration.getAdUnitId(extras);
    if (TextUtils.isEmpty(mAdUnitId)) {
        MoPubLog.log(getAdNetworkId(), CUSTOM, ADAPTER_NAME, "Received invalid Ogury ad " + "unit ID for rewarded ad. Failing ad request.");
        MoPubLog.log(getAdNetworkId(), LOAD_FAILED, ADAPTER_NAME, MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR.getIntCode(), MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
        if (mLoadListener != null) {
            mLoadListener.onAdLoadFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
        }
        return;
    }
    mOguryAdapterConfiguration.setCachedInitializationParameters(context, extras);
    mListenerHelper = new OguryAdListenerHelper(ADAPTER_NAME, mAdUnitId);
    mListenerHelper.setLoadListener(mLoadListener);
    mOptInVideo = new OguryOptinVideoAd(context, mAdUnitId);
    mOptInVideo.setListener(this);
    mOptInVideo.setAdImpressionListener(this);
    mOptInVideo.load();
    MoPubLog.log(getAdNetworkId(), LOAD_ATTEMPTED, ADAPTER_NAME);
}
Also used : PersonalInfoManager(com.mopub.common.privacy.PersonalInfoManager) OguryOptinVideoAd(com.ogury.ed.OguryOptinVideoAd)

Example 8 with PersonalInfoManager

use of com.mopub.common.privacy.PersonalInfoManager in project mopub-android-mediation by mopub.

the class TapjoyRewardedVideo method fetchMoPubGDPRSettings.

// Pass the user consent from the MoPub SDK to Tapjoy as per GDPR
private void fetchMoPubGDPRSettings() {
    PersonalInfoManager personalInfoManager = MoPub.getPersonalInformationManager();
    if (personalInfoManager != null) {
        Boolean gdprApplies = personalInfoManager.gdprApplies();
        if (gdprApplies != null) {
            tjPrivacyPolicy.setSubjectToGDPR(gdprApplies);
            if (gdprApplies) {
                String userConsented = MoPub.canCollectPersonalInformation() ? "1" : "0";
                tjPrivacyPolicy.setUserConsent(userConsented);
            } else {
                tjPrivacyPolicy.setUserConsent("-1");
            }
        }
    }
}
Also used : PersonalInfoManager(com.mopub.common.privacy.PersonalInfoManager)

Example 9 with PersonalInfoManager

use of com.mopub.common.privacy.PersonalInfoManager in project mopub-android-mediation by mopub.

the class UnityAdsInitializer method initGdpr.

private void initGdpr(Context context) {
    // Pass the user consent from the MoPub SDK to Unity Ads as per GDPR
    PersonalInfoManager personalInfoManager = MoPub.getPersonalInformationManager();
    final boolean canCollectPersonalInfo = MoPub.canCollectPersonalInformation();
    final boolean shouldAllowLegitimateInterest = MoPub.shouldAllowLegitimateInterest();
    if (personalInfoManager != null && personalInfoManager.gdprApplies() == Boolean.TRUE) {
        final MetaData gdprMetaData = new MetaData(context);
        if (shouldAllowLegitimateInterest) {
            if (personalInfoManager.getPersonalInfoConsentStatus() == ConsentStatus.EXPLICIT_NO || personalInfoManager.getPersonalInfoConsentStatus() == ConsentStatus.DNT) {
                gdprMetaData.set("gdpr.consent", false);
            } else {
                gdprMetaData.set("gdpr.consent", true);
            }
        } else {
            gdprMetaData.set("gdpr.consent", canCollectPersonalInfo);
        }
        gdprMetaData.commit();
    }
}
Also used : PersonalInfoManager(com.mopub.common.privacy.PersonalInfoManager) MetaData(com.unity3d.ads.metadata.MetaData) MediationMetaData(com.unity3d.ads.metadata.MediationMetaData)

Example 10 with PersonalInfoManager

use of com.mopub.common.privacy.PersonalInfoManager in project mopub-android-mediation by mopub.

the class MoPubListFragment method onChangeConsent.

/**
 * Call this function to grant or revoke user consent
 *
 * @param consentGranted - true to grant consent, false to revoke
 * @return - true successfully completed operation, false failed for some reason
 */
boolean onChangeConsent(final boolean consentGranted) {
    final PersonalInfoManager personalInfoManager = MoPub.getPersonalInformationManager();
    final View view = getView();
    if (personalInfoManager == null || view == null) {
        MoPubLog.log(MoPubLog.SdkLogEvent.CUSTOM, getString(R.string.pim_is_not_available));
        return false;
    }
    final EditText text = view.findViewById(R.id.status_change_notification);
    text.setVisibility(View.VISIBLE);
    if (consentGranted) {
        personalInfoManager.grantConsent();
        text.setText(R.string.consent_whitelisted);
    } else {
        if (personalInfoManager.getPersonalInfoConsentStatus().equals(ConsentStatus.DNT)) {
            text.setText(R.string.donottrack_text);
            return false;
        }
        personalInfoManager.revokeConsent();
        text.setText(R.string.consent_denied);
    }
    return true;
}
Also used : EditText(android.widget.EditText) PersonalInfoManager(com.mopub.common.privacy.PersonalInfoManager) View(android.view.View) TextView(android.widget.TextView) ListView(android.widget.ListView)

Aggregations

PersonalInfoManager (com.mopub.common.privacy.PersonalInfoManager)12 ConsentData (com.mopub.common.privacy.ConsentData)2 ConsentStatus (com.mopub.common.privacy.ConsentStatus)2 Context (android.content.Context)1 View (android.view.View)1 EditText (android.widget.EditText)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 AdColonyAppOptions (com.adcolony.sdk.AdColonyAppOptions)1 NavigationView (com.google.android.material.navigation.NavigationView)1 AdvertisingId (com.mopub.common.privacy.AdvertisingId)1 OguryBannerAdSize (com.ogury.ed.OguryBannerAdSize)1 OguryBannerAdView (com.ogury.ed.OguryBannerAdView)1 OguryInterstitialAd (com.ogury.ed.OguryInterstitialAd)1 OguryOptinVideoAd (com.ogury.ed.OguryOptinVideoAd)1 MediationMetaData (com.unity3d.ads.metadata.MediationMetaData)1 MetaData (com.unity3d.ads.metadata.MetaData)1 InitCallback (com.vungle.warren.InitCallback)1 VungleSettings (com.vungle.warren.VungleSettings)1 VungleException (com.vungle.warren.error.VungleException)1