Hallo zusammen,
um gdpr-konform zu sein, habe ich folgende Anleitung befolgt: https://developers.google.com/admob/ump/android/quick-start
Gemacht hab ich folgendes:
und
Leider bekomme ich immer den "Error"-Toast und lande in onConsentInfoUpdateFailure(FormError formError) unabhängig ob ich auf meinem Handy oder auf einem virtuellen Device teste.
Kann mir da jemand helfen, fehlt mir noch was?
Danke und Grüsse
celdrion
um gdpr-konform zu sein, habe ich folgende Anleitung befolgt: https://developers.google.com/admob/ump/android/quick-start
Gemacht hab ich folgendes:
- funding choices mit admob verbunden
- ump zu build.gradle zugefügt
- app ID im android manifest eingetragen
- einen Dialog für meine App in admob erstellt und aktiviert
Java:
ConsentRequestParameters params = new ConsentRequestParameters
.Builder()
.setTagForUnderAgeOfConsent(false)
.build();
consentInformation = UserMessagingPlatform.getConsentInformation(this);
consentInformation.requestConsentInfoUpdate(
this,
params,
new ConsentInformation.OnConsentInfoUpdateSuccessListener() {
@Override
public void onConsentInfoUpdateSuccess() {
// The consent information state was updated.
// You are now ready to check if a form is available.
if (consentInformation.isConsentFormAvailable()) {
loadForm();
}
else {
Context context = getApplicationContext();
CharSequence toastText = "No Form Available";
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(context, toastText, duration);
toast.show();
}
}
},
new ConsentInformation.OnConsentInfoUpdateFailureListener() {
@Override
public void onConsentInfoUpdateFailure(FormError formError) {
Context context = getApplicationContext();
CharSequence toastText = "Error";
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(context, toastText, duration);
toast.show();
}
});
und
Java:
public void loadForm() {
UserMessagingPlatform.loadConsentForm(
this,
new UserMessagingPlatform.OnConsentFormLoadSuccessListener() {
@Override
public void onConsentFormLoadSuccess(ConsentForm consentForm) {
MainActivity.this.consentForm = consentForm;
if(consentInformation.getConsentStatus() == ConsentInformation.ConsentStatus.REQUIRED) {
consentForm.show(
MainActivity.this,
new ConsentForm.OnConsentFormDismissedListener() {
@Override
public void onConsentFormDismissed(@Nullable FormError formError) {
// Handle dismissal by reloading form.
loadForm();
}
});
}
}
},
new UserMessagingPlatform.OnConsentFormLoadFailureListener() {
@Override
public void onConsentFormLoadFailure(FormError formError) {
// Handle the error
}
}
);
}
Leider bekomme ich immer den "Error"-Toast und lande in onConsentInfoUpdateFailure(FormError formError) unabhängig ob ich auf meinem Handy oder auf einem virtuellen Device teste.
Kann mir da jemand helfen, fehlt mir noch was?
Danke und Grüsse
celdrion