마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

android GDPR "Error: request is not in EEA or unknown." 에러가 뜨는 이유

0 추천
public GdprHelper(Context context) {
        this.context = context;
    }

    public void initialise() {
        ConsentInformation consentInformation = ConsentInformation.getInstance(context);
        consentInformation.addTestDevice(PUBLISHER_ID);
        consentInformation.setDebugGeography(DebugGeography.DEBUG_GEOGRAPHY_EEA);

        consentInformation.requestConsentInfoUpdate(new String[]{PUBLISHER_ID}, new ConsentInfoUpdateListener() {
            @Override
            public void onConsentInfoUpdated(ConsentStatus consentStatus) {
                if(consentStatus == ConsentStatus.UNKNOWN){
                    displayConsentForm();
                }
            }

            @Override
            public void onFailedToUpdateConsentInfo(String errorDescription) {
                Dlog.e("errorDescription : " + errorDescription);
            }
        });
    }

    private void displayConsentForm() {

        consentForm = new ConsentForm.Builder(context, getPrivacyUrl())
                .withListener(new ConsentFormListener() {
                    @Override
                    public void onConsentFormLoaded() {
                        consentForm.show();
                    }

                    @Override
                    public void onConsentFormOpened() {
                    }

                    @Override
                    public void onConsentFormClosed(
                            ConsentStatus consentStatus, Boolean userPrefersAdFree) {
                    }

                    @Override
                    public void onConsentFormError(String errorDescription) {
                        Dlog.e("errorDescription : " + errorDescription);
                    }
                })
                .withPersonalizedAdsOption()
                .withNonPersonalizedAdsOption()
                .withAdFreeOption()
                .build();
        consentForm.load();
    }

    private URL getPrivacyUrl() {
        URL privacyUrl = null;
        try {
            privacyUrl = new URL(PRIVACY_URL);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        return privacyUrl;
    }

    private void redirectToPaidVersion() {
        Intent i = new Intent(
                Intent.ACTION_VIEW,
                Uri.parse(MARKET_URL_PAID_VERSION));
        context.startActivity(i);
    }

    public void resetConsent() {
        ConsentInformation consentInformation = ConsentInformation.getInstance(context);
        consentInformation.reset();
    }

GDPR 클래스인데 분명 아래 코드로 EEA 설정 했는데 Error: request is not in EEA or unknown.  에러가 뜹니다.

consentInformation.setDebugGeography(DebugGeography.DEBUG_GEOGRAPHY_EEA);
jay_choi (530 포인트) 님이 2023년 10월 18일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...