使用 AS3 脚本实现 GDPR UMP

GDPR UMP Implementation Using AS3 Script

提问人:Free Lancer 提问时间:9/26/2023 更新时间:9/26/2023 访问量:54

问:

我需要你们的小帮助。我使用 AS3 脚本在我的游戏上实现了 UMP 同意。甚至我也在我的 AdMob 帐户上启用了 GDPR 设置。 但是,当我使用测试设备在我的手机上进行测试时,它无法在我的设备上打开。 在我的设备上调试时,我得到了这个输出日志:

IDFA.isSupported true
authorisationStatus authorised
Adverts.service.ump.isSupported true
params [object ConsentRequestParameters]
consentInformation [object _ConsentInformationImpl]
consent getConsentStatus(): 0
consent getConsentType():   0
status authorised
TrackingAuthorisationStatus.AUTHORISED authorised
getIdFA condition true by developer
Event in event.authorisationStatus authorised
identifier: xxxx-xxxx-xxxx-xxx-xxxxxx
isLimitAdTrackingEnabled: false
consentInformation_updateSuccessHandler()
consentisConsentFormAvailable():   false
umploadForm() No form available

但是在这种形式之后,它没有打开。 请伙计们帮我解决这个问题..下面我附上了脚本:

import com.distriqt.extension.idfa.IDFA;
import com.distriqt.extension.idfa.TrackingAuthorisationStatus;
import com.distriqt.extension.idfa.events.IDFAEvent;
import com.distriqt.extension.adverts.ump.*;
import com.distriqt.extension.adverts.ump.events.*;
import com.distriqt.extension.adverts.*;
import `com.distriqt.extension.adverts.consent.ConsentStatus;

if (IDFA.isSupported) {
// Functionality here
IDFA.service.addEventListener(IDFAEvent.COMPLETE, idfaCompleteHandler);
authorisationStatus = IDFA.service.authorisationStatus();`
trace("authorisationStatus " + authorisationStatus)
IDFA.service.requestAuthorisation(
function (status: String): void {
trace("status " + status)
trace("TrackingAuthorisationStatus.AUTHORISED " + TrackingAuthorisationStatus.AUTHORISED)
if (status == TrackingAuthorisationStatus.AUTHORISED) {
trace("getIdFA condition true by developer")
IDFA.service.getIDFA();
}
}
);
}
/////////////////////////////////////Consent
trace("Adverts.service.ump.isSupported " + Adverts.service.ump.isSupported);
if (Adverts.service.ump.isSupported) {
consentInformation = Adverts.service.ump.getConsentInformation();


var params: ConsentRequestParameters = new ConsentRequestParameters()
.setTagForUnderAgeOfConsent(false)
.setConsentDebugSettings(
new ConsentDebugSettings()                      //.addTestDeviceHashedId("ACD1D936A7320003236EF0C6E33A3100")
.addTestDeviceHashedId("xxxx-xxxx-xxxx-xxx-xxxxxx")
.setDebugGeography(DebugGeography.DEBUG_GEOGRAPHY_EEA)
);

trace("params " + params)
consentInformation.requestConsentInfoUpdate(params);
consentInformation.addEventListener(ConsentInformationEvent.CONSENT_INFO_UPDATE_SUCCESS, consentInformation_updateSuccessHandler);
                consentInformation.addEventListener(ConsentInformationEvent.CONSENT_INFO_UPDATE_FAILURE, consentInformation_updateFailureHandler);

trace("consentInformation " + consentInformation)
trace("consent getConsentStatus(): " + consentInformation.getConsentStatus());
trace("consent getConsentType():   " + consentInformation.getConsentType());
}
}

function idfaCompleteHandler(event: IDFAEvent): void {
trace("Event in event.authorisationStatus " + authorisationStatus)
trace("identifier: " + event.identifier);
trace("isLimitAdTrackingEnabled: " + event.isLimitAdTrackingEnabled);
}
function consentInformation_updateSuccessHandler(event: ConsentInformationEvent): void {
trace("consentInformation_updateSuccessHandler()");
trace("consent isConsentFormAvailable():   " + consentInformation.isConsentFormAvailable());
if (consentInformation.isConsentFormAvailable()) {
                Adverts.service.ump.addEventListener(UserMessagingPlatformEvent.CONSENT_FORM_LOAD_SUCCESS, ump_loadFormSuccessHandler);
                Adverts.service.ump.addEventListener(UserMessagingPlatformEvent.CONSENT_FORM_LOAD_FAILURE, ump_loadFormFailureHandler);
Adverts.service.ump.loadConsentForm();
} else {
trace("ump_loadForm() No form available");
}
            
}
function consentInformation_updateFailureHandler(event: ConsentInformationEvent): void {
trace("consentInformation_updateFailureHandler() : [" + event.error.errorID + "] " + event.error.message);
            event.currentTarget.removeEventListener(ConsentInformationEvent.CONSENT_INFO_UPDATE_SUCCESS, consentInformation_updateSuccessHandler);
            event.currentTarget.removeEventListener(ConsentInformationEvent.CONSENT_INFO_UPDATE_FAILURE, consentInformation_updateFailureHandler);
}

function ump_loadFormSuccessHandler(event: UserMessagingPlatformEvent): void {
trace("ump_loadFormSuccessHandler() " + Adverts.service.ump.getConsentInformation().getConsentStatus());
if (Adverts.service.ump.getConsentInformation().getConsentStatus() == ConsentStatus.REQUIRED) {
trace(" Form loaded and ready to be showed");
                Adverts.service.ump.addEventListener(UserMessagingPlatformEvent.CONSENT_FORM_DISMISSED, formDismissedHandler);
Adverts.service.ump.showConsentForm();
}
}
function ump_loadFormFailureHandler(event: UserMessagingPlatformEvent): void {
trace("ump_loadFormFailureHandler() : [" + event.error.errorID + "] " + event.error.message);
}
private function formDismissedHandler(event: UserMessagingPlatformEvent): void {
trace(" Handle form dismissal");
}

我期待你们解决我的问题。这样我就可以自由了。因为我正在努力解决这个问题。

ActionScript-3 AdMob Air GDPRAsconsentForm Distriqt

评论


答: 暂无答案