Google EU 사용자 동의에 따름 정책에 따라 EEA (유럽 경제 지역)의 사용자에게 쿠키 또는 기타 로컬 저장소의 사용에 대한 동의를 얻습니다. 개인 정보 (예: 광고 ID)를 사용하여 광고를 게재하거나, 법적으로 필요한 경우. 이 정책에는 EU 온라인 개인 정보 보호 지침 및 개인 정보 보호법 (GDPR)
게시자가 이 정책의 의무 조항을 준수할 수 있도록 Google은 사용자 메시지 플랫폼 (UMP) SDK. UMP SDK가 최신 IAB 표준을 준수해야 합니다. 이제 이러한 모든 구성을 개인 정보 보호 및 Ad Manager 개인 정보 보호 및 메시지를 보낼 수 있습니다.
기본 요건
- 시작 가이드를 모두 읽어보세요.
- GDPR 관련 요구사항을 수행하는 경우 IAB 요구사항이 EU 동의에 미치는 영향 메시지
메시지 유형 만들기
다음 중 하나로 사용자 메시지를 작성합니다. 사용 가능한 사용자 메시지 유형 Privacy & 메시지 탭에서 애드 관리자 있습니다. UMP SDK는 애플리케이션 ID에서 Ad Manager 생성된 사용자 메시지 확인할 수 있습니다 애플리케이션에 메시지가 구성되어 있지 않으면 SDK는 오류가 반환됩니다.
자세한 내용은 개인 정보 보호 및 메시지 정보
애플리케이션 ID 추가
다음에서 애플리케이션 ID를 찾을 수 있습니다. Ad Manager UI. ID를 다음 코드 스니펫으로 대체합니다.
동의 정보 요청
모든 앱에서 사용자 동의 정보 업데이트를 요청해야 합니다.
requestConsentInfoUpdate()
를 사용하여 실행합니다. 이는
사용자가 아직 동의하지 않은 경우 동의를 제공해야 하는지 여부
사용자의 동의가 만료된 경우
다음은 앱 시작 시 상태를 확인하는 방법의 예입니다.
@override
void initState() {
super.initState();
// Create a ConsentRequestParameters object.
final params = ConsentRequestParameters();
// Request an update for the consent information.
ConsentInformation.instance.requestConsentInfoUpdate(
params,
() async {
// TODO: Load and present the consent form.
},
(FormError error) {
// Handle the error.
},
);
}
필요한 경우 동의 양식 로드 및 표시
최신 동의 상태를 받은 후
loadAndShowConsentFormIfRequired()
ConsentForm
클래스를 사용하여 동의 양식을 로드합니다. 만약
동의 상태가 필요한 경우 SDK가 양식을 로드하고 즉시 제시
제공된 값에서 . callback
는 양식이 닫힌 후에 호출됩니다. 동의가 필요하지 않은 경우 callback
가 즉시 호출됩니다.
@override
void initState() {
super.initState();
// Create a ConsentRequestParameters object.
final params = ConsentRequestParameters();
// Request an update for the consent information.
ConsentInformation.instance.requestConsentInfoUpdate(
params,
() async {
ConsentForm.loadAndShowConsentFormIfRequired((loadAndShowError) {
if (loadAndShowError != null) {
// Consent gathering failed.
}
// Consent has been gathered.
});
},
(FormError error) {
// Handle the error.
},
);
}
사용자가 결정을 내렸거나 닫은 후 작업을 실행해야 하는 경우 callback에 로직을 배치합니다. 선택합니다.
광고 요청
앱에서 광고를 요청하기 전에 동의를 얻었는지 확인하세요.
canRequestAds()
를 사용하여 사용자로부터 반환합니다. 두 가지
동의를 수집할 때 확인해야 할 곳은 다음과 같습니다.
- 현재 세션에서 동의가 수집된 후
-
requestConsentInfoUpdate()
를 호출한 직후 이전 세션에서 동의를 받았을 수 있습니다. 지연 시간 콜백이 완료될 때까지 기다리지 않는 것이 좋습니다. 그래야 최대한 빨리 광고 로드를 시작하세요
동의 수집 과정에서 오류가 발생하더라도 광고를 요청할 수 없습니다. UMP SDK는 이전 세션입니다.
class AppExampleState extends State<AppExample> {
// Use a bool to initialize the Mobile Ads SDK and load ads once.
var _isMobileAdsInitializeCalled = false;
@override
void initState() {
super.initState();
// Create a ConsentRequestParameters object.
final params = ConsentRequestParameters();
// Request an update for the consent information.
ConsentInformation.instance.requestConsentInfoUpdate(
params,
() async {
ConsentForm.loadAndShowConsentFormIfRequired((loadAndShowError) {
if (loadAndShowError != null) {
// Consent gathering failed.
}
// Consent has been gathered.
_initializeMobileAdsSDK();
});
},
(FormError error) {
// Handle the error.
},
);
// Check if you can initialize the Mobile Ads SDK in parallel while
// checking for new consent information. Consent obtained in the
// previous session can be used to request ads.
_initializeMobileAdsSDK();
}
void _initializeMobileAdsSDK() async {
if (_isMobileAdsInitializeCalled) {
return;
}
// Initialize the Mobile Ads SDK if the SDK has gathered consent aligned with
// the app's configured messages.
var canRequestAds = await ConsentInformation.instance.canRequestAds();
if (canRequestAds) {
setState(() {
_isMobileAdsInitializeCalled = true;
});
// Initialize the Mobile Ads SDK.
MobileAds.instance.initialize();
// TODO: Request an ad.
}
}
}
공개 설정 옵션
일부 동의 양식은 사용자가 언제든지 동의를 수정해야 합니다. 준수 필요한 경우 다음 단계로 이동하여 개인 정보 보호 옵션 버튼을 구현합니다.
이 경우 방법은 다음과 같습니다.
- 앱 설정 페이지의 버튼과 같은 UI 요소를 구현합니다. 개인 정보 보호 옵션 양식을 트리거할 수 있습니다.
- 완료되면
loadAndShowConsentFormIfRequired()
다음을 확인합니다.getPrivacyOptionsRequirementStatus()
표시될지 아니면 개인 정보 보호 옵션 양식을 표시할 수 있는 UI 요소입니다. - 사용자가 UI 요소와 상호작용하면
showPrivacyOptionsForm()
양식을 표시하여 사용자가 언제든지 개인 정보 보호 옵션을 업데이트할 수 있습니다
class AppExampleState extends State<AppExample> {
static const _privacySettingsText = 'Privacy Settings';
// Use a bool to initialize the Mobile Ads SDK and load ads once.
var _isMobileAdsInitializeCalled = false;
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'App Example',
home: Scaffold(
appBar: AppBar(
title: const Text('App Example'),
actions: _isMobileAdsSDKInitialized
// Regenerate the options menu to include a privacy setting.
? _privacySettingsAppBarAction()
: null
),
body: // ...
),
);
}
List<Widget> _privacySettingsAppBarAction() {
return <Widget>[
FutureBuilder(
future: ConsentInformation.instance.isPrivacyOptionsRequired(),
builder: (context, snapshot) {
final bool visibility = snapshot.data ?? false;
return Visibility(
visible: visibility,
child: PopupMenuButton<String>(
onSelected: (String result) {
if (result == _privacySettingsText) {
ConsentForm.showPrivacyOptionsForm((formError) {
if (formError != null) {
debugPrint(
"${formError.errorCode}: ${formError.message}");
}
});
}
},
itemBuilder: (BuildContext context) =>
<PopupMenuEntry<String>>[
const PopupMenuItem<String>(
value: _privacySettingsText,
child: Text(_privacySettingsText))
],
));
})
];
}
}
테스트
개발하는 동안 앱에서 통합을 테스트하려면 다음 단계에 따라 테스트 기기를 프로그래매틱 방식으로 등록하세요. 반드시 를 사용하는 것이 좋습니다.
-
requestConsentInfoUpdate()
를 호출합니다. 로그 출력에서 다음 예와 비슷한 메시지를 확인합니다. 에 기기 ID와 테스트 기기로 추가하는 방법이 표시됩니다.
Android
Use new ConsentDebugSettings.Builder().addTestDeviceHashedId("33BE2250B43518CCDA7DE426D04EE231") to set this as a debug device.
iOS
<UMP SDK>To enable debug mode for this device, set: UMPDebugSettings.testDeviceIdentifiers = @[2077ef9a63d2b398840261c8221a0c9b]
테스트 기기 ID를 클립보드에 복사합니다.
코드를 수정하여 전화
ConsentDebugSettings.testIdentifiers
다음으로 전달합니다. 테스트 기기 ID 목록입니다.ConsentDebugSettings debugSettings = ConsentDebugSettings( testIdentifiers: ["TEST-DEVICE-HASHED-ID"], ); ConsentRequestParameters params = ConsentRequestParameters(consentDebugSettings: debugSettings); ConsentInformation.instance.requestConsentInfoUpdate(params, () async { // ... };
지역 강제 설정
UMP SDK는 마치 기기가 제대로 작동하지 않는 것처럼 앱 동작을 테스트하는 방법을 제공합니다.
the DebugGeography
field on ConsentDebugSettings
를 사용하여 EEA 또는 영국에 거주 참고:
디버그 설정은 테스트 기기에서만 작동합니다.
ConsentDebugSettings debugSettings = ConsentDebugSettings(
debugGeography: DebugGeography.debugGeographyEea,
testIdentifiers: ["TEST-DEVICE-HASHED-ID"],
);
ConsentRequestParameters params =
ConsentRequestParameters(consentDebugSettings: debugSettings);
ConsentInformation.instance.requestConsentInfoUpdate(params, () async {
// ...
};
동의 상태 재설정
UMP SDK로 앱을 테스트할 때
사용자의 첫 설치 환경을 시뮬레이션할 수 있습니다.
SDK에서는 이를 위한 reset()
메서드를 제공합니다.
ConsentInformation.instance.reset();