# 연동 기본 설정

## 1. 매니페스트 설정

애드팝콘 SSP를 이용하기 위한 내용을 AndroidManifest.xml 파일에 추가합니다.

### 1) 앱 키 추가

AdPopcornSSP 홈페이지에서 애드팝콘 앱 등록 후 발급받은 앱 키를 <mark style="color:red;">`<application></application>`</mark>  태그 안에 추가합니다.

{% code title="XML" %}

```xml
<application>
... 
<meta-data android:name="adpopcorn_ssp_app_key" android:value="이곳에_앱키를_입력하세요" />
...
</application>
```

{% endcode %}

### 2) 퍼미션 추가

<mark style="color:red;">`<manifest></manifest>`</mark>태그 안에 필수 퍼미션을 추가합니다.

{% code title="XML" %}

```xml
<manifest>
... <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
...
</manifest>
```

{% endcode %}

## 2. 미디에이션 설정

애드팝콘에서는 2가지 형태의 미디에이션을 지원합니다. 하나의 방식을 선택하여 연동 진행해 주세요.

* 애드팝콘 미디에이션

{% content-ref url="../../../undefined-1/ap/ap-unity-aos" %}
[ap-unity-aos](https://adpopcornssp.gitbook.io/ssp-sdk/undefined-1/ap/ap-unity-aos)
{% endcontent-ref %}

* Max 미디에이션(Beta) : 사용하고자 할 경우 사업팀에 문의 하세요

{% content-ref url="../../../undefined-1/max-beta/max-beta-unity-aos" %}
[max-beta-unity-aos](https://adpopcornssp.gitbook.io/ssp-sdk/undefined-1/max-beta/max-beta-unity-aos)
{% endcontent-ref %}

## 3. 코드 연동

### 1) SDK 초기화 및 리소스 해제

initWithListener API와 destroy API를 통해 SDK 동작을 제어합니다.&#x20;

```csharp
public class AdPopcornSSPSampleScene : MonoBehaviour, IInitEventCallbackListener
{
	void Start (){	
		AdPopcornSSPPlugin.initWithListener (this);
	}
	
	void IInitEventCallbackListener.OnInitializationFinished()
	{
	     // init 작업이 완료 된 뒤, 광고 로드 작업을 진행해 주시기 바랍니다.
	}

	void OnDestroy(){	
	    AdPopcornSSPPlugin.destroy();
	}
}
```

### 2) GDPR 설정

EU의 GDPR (General Data protection Regulation) 법안에 대응하기 위해 아래 API를 추가 합니다.

GDPR 동의 여부 세팅을 위해 아래의 API가 추가 되었습니다. 기본 값은 <mark style="color:red;">True</mark>이고 GDPR 동의가 필요한 유저에 한해 아래 API를 호출하시기 바랍니다.

```csharp
AdPopcornSSPPlugin.gdprConsentAvailable(false);
```

### 3) COPPA 설정

COPPA 대응을위해 아래의 API가 추가 되었습니다. 기본 값은 <mark style="color:red;">false</mark> 이고 COPPA에 따라 콘텐츠를 아동 대상으로 지정하려면 아래 API를 이용하여 true로 설정해 주세요

```csharp
AdPopcornSSPPlugin.tagForChildDirectedTreatment(true);
```

* google families policy : <https://play.google.com/about/families/#!?zippy_activeEl=designed-for-families#designed-for-families>
* coppa : <https://www.ftc.gov/tips-advice/business-center/privacy-and-security/children's-privacy>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://adpopcornssp.gitbook.io/ssp-sdk/sdk/unity/unity-android/undefined.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
