# 기본 설정

## 1. SDK 설치

* Android

아래 page 의 AdPopcornSSP Android SDK 설치 및 Manifest.xml 설정까지 확인하여 앱 내 세팅해줍니다.

{% content-ref url="/pages/07ujY2ZLJDcbzJ7a5WW6" %}
[기본 설정](/ssp-sdk/sdk/android/undefined.md)
{% endcontent-ref %}

* iOS

아래 page 의 AdPopcornSSP iOS SDK 설치 및 <mark style="color:red;">IDFA 설정</mark>까지 확인하여 앱 내 세팅하여 줍니다.

{% content-ref url="/pages/fMDRjZmIzDTLySHdYr2S" %}
[기본 설정](/ssp-sdk/sdk/ios/ios/undefined.md)
{% endcontent-ref %}

## 2. 플러그인 설치

현재는 베타 버전으로 npm 을 통한 설치는 지원하지 않으며, 수동 설치 만을 지원합니다.

[\[플러그인 다운로드 링크\]](https://github.com/IGAWorksDev/AdPopcornSDK/raw/refs/heads/master/AdPopcornSSP/05-etc/AdPopcornSSPReactPlugin_Beta_0.3.0.zip)

### 2.1 Android

* 위 압축 파일에 들어있는 android 폴더를 프로젝트 내 <mark style="color:blue;">`../android/app/src/main/java/{packagename}`</mark>경로에 추가합니다.&#x20;

<figure><img src="/files/jHkybjAshqm3xLGo1IfH" alt=""><figcaption></figcaption></figure>

* android 프로젝트 내 <mark style="color:red;">`MainApplication.java`</mark> 파일에서 RNAdPopcornSSPPackage 선언을 추가합니다.&#x20;

{% code title="JAVA" %}

```java
public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost =
        @Override
        protected List<ReactPackage> getPackages() {
          List<ReactPackage> packages = new PackageList(this).getPackages();
          // Packages that cannot be autolinked yet can be added manually here, for example:
          packages.add(new RNAdPopcornSSPPackage());
          return packages;
        }
}
```

{% endcode %}

{% hint style="info" %}
ex> RNAdPopcornSSPPackage import 시 설치 경로의 packagename 부분이 com/adpopcornsspreactplugin 이라면, 아래와 같이 import 해와야 합니다.

```java
package com.adpopcornsspreactplugin;
import com.adpopcornsspreactplugin.adpopcorn.RNAdPopcornSSPPackage;
```

{% endhint %}

### 2.2 iOS

* 위 압축 파일에 들어있는 ios 폴더를 프로젝트 내에 추가합니다.

<figure><img src="/files/O9KjCyZjyZ6ftH6wQq1C" alt=""><figcaption></figcaption></figure>

* Xcode 프로젝트 내에 추가한 14개의 파일을 Add 해줍니다.

<figure><img src="/files/OwPX7kHFA8ypwp0yqHLK" alt=""><figcaption></figcaption></figure>

* 파일을 모두 add 할 경우 아래와 같이 xcode에서 보이게 됩니다.

<figure><img src="/files/nPw3HgH8l6VKLsl6IZW4" alt=""><figcaption></figcaption></figure>

### 2.3 배너, 네이티브 뷰 설정

배너, 네이티브 연동을 하고자 할 경우에는 플러그인 압축 파일 내 src 폴더에 들어 있는 <mark style="color:red;">`AdPopcornBanner.tsx`</mark>, <mark style="color:red;">`AdPopcornNative.tsx`</mark> 파일을 react 프로젝트 내 <mark style="color:blue;">`src/ads/adpopcornssp/`</mark> 경로에 추가해줍니다.

<figure><img src="/files/KjBZvMIZ8JhZmzQ1FfJ6" alt=""><figcaption></figcaption></figure>

## 3. 미디에이션 설정

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

* 애드팝콘 미디에이션

{% content-ref url="/pages/XOGmPFQT7s0MbvOgKf5n" %}
[AP 미디에이션(Android)](/ssp-sdk/undefined-1/ap/ap-android.md)
{% endcontent-ref %}

{% content-ref url="/pages/IP2R7MXm9WlEBdvJxfnZ" %}
[AP 미디에이션(iOS) (구)](/ssp-sdk/undefined-1/ap/ap-ios-1.md)
{% endcontent-ref %}

* Max 미디에이션(Beta) : 사용하고자 할 경우 사업팀(<pm@adpopcorn.com>)에 문의 하세요

{% content-ref url="/pages/esnyF96ixFtxH0IuGWzx" %}
[MAX 미디에이션(Beta, Android)](/ssp-sdk/undefined-1/max-beta/max-beta-android.md)
{% endcontent-ref %}

{% content-ref url="/pages/inI4X4hiPeJ8WPpyw8Zg" %}
[MAX 미디에이션(Beta, iOS)(구)](/ssp-sdk/undefined-1/max-beta/max-beta-ios-1.md)
{% endcontent-ref %}

## 4. 초기화

앱 시작 시, <mark style="color:red;">`RNAdPopcornSSPModule`</mark> 를 이용하여 <mark style="color:red;">`init`</mark> function을 호출하여줍니다.

{% code title="JavaScript" %}

```javascript
import React, { useEffect } from 'react';
import {
  NativeModules,
  NativeEventEmitter
} from 'react-native';

const RNAdPopcornSSPModule = NativeModules.RNAdPopcornSSPModule;

function App(): JSX.Element {
  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
  };
  RNAdPopcornSSPModule.init('your app key');
  ....
}
```

{% endcode %}


---

# 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/react-native-beta/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.
