# 마이그레이션 가이드

## 마이그레이션 체크리스트

* [ ] `pod 'AdPopcornSSP'` → `pod 'APSSPSDK'` + 미디에이션 adapter Pod 추가
* [ ] `use_frameworks! :linkage => :static` 추가
* [ ] `#import <AdPopcornSSP/...>` → `@import APSSPSDK;`
* [ ] 초기화 코드 변경 (`APSSPInitializationSettings` + `APSSPAds.initializeSDK`)
* [ ] 광고 클래스명 변경 (`AdPopcornSSP...` → `APSSP...`)
* [ ] 생성자 파라미터명 변경 (`Key:` → `AppKey:`, `viewController:` → `rootViewController:`)
* [ ] 로드 메서드 변경 (`loadRequest` → `load` 또는 `loadAd`)
* [ ] 노출 메서드 변경 (`presentFromViewController:` → `presentFrom:`)
* [ ] Delegate 프로토콜명 변경
* [ ] Delegate 메서드명 변경 (대문자 시작 → 소문자 시작, `With` 파라미터 추가)
* [ ] 에러 타입 변경 (`AdPopcornSSPError *` → `APSSPNetworkError` enum)
* [ ] 배너 사이즈 enum 변경
* [ ] 네이티브 Renderer 바인딩 메서드 변경
* [ ] 하이브리드 브릿지 JS handler 이름 변경 (해당 시)
* [ ] 수동 adapter 파일 제거 (Pod으로 대체)
* [ ] 빌드 & 테스트

## 개요

| 항목            | 기존 (ObjC SDK)                           | 신규 (Swift SDK)                                         |
| ------------- | --------------------------------------- | ------------------------------------------------------ |
| Pod 이름        | `AdPopcornSSP`                          | `APSSPSDK`                                             |
| import        | `#import <AdPopcornSSP/AdPopcornSSP.h>` | `@import APSSPSDK;` (ObjC) / `import APSSPSDK` (Swift) |
| 최소 지원         | iOS 12.0                                | iOS 13.0                                               |
| 언어            | Objective-C                             | Swift (ObjC 호환)                                        |
| 미디에이션 Adapter | 별도 수동 설치                                | CocoaPods / SPM 자동 설치                                  |

***

## 1. SDK 설치 변경

### 기존 (ObjC)

```ruby
pod 'AdPopcornSSP'
```

### 신규 (Swift)

```ruby
use_frameworks! :linkage => :static

pod 'APSSPSDK', '3.1.0'
pod 'APSSPMediationAdMob'       # 사용할 업체만 추가
pod 'APSSPMediationVungle'
# ...
```

{% hint style="warning" %}
`use_frameworks! :linkage => :static` 필수 추가
{% endhint %}

***

## 2. import 변경

| 기존                                                    | 신규                       |
| ----------------------------------------------------- | ------------------------ |
| `#import <AdPopcornSSP/AdPopcornSSP.h>`               | `@import APSSPSDK;`      |
| `#import <AdPopcornSSP/AdPopcornSSPBannerView.h>`     | `@import APSSPSDK;` (통합) |
| `#import <AdPopcornSSP/AdPopcornSSPInterstitialAd.h>` | `@import APSSPSDK;` (통합) |

Swift SDK는 모든 public API가 하나의 모듈(`APSSPSDK`)에 포함되어 있으므로 `@import APSSPSDK;` 하나로 충분합니다.

***

## 3. 초기화 변경

| 기존 (ObjC SDK)         | 신규 — Objective-C                                         | 신규 — Swift                                               |
| --------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| `AdPopcornSSP` 초기화 방식 | `APSSPInitializationSettings` + `APSSPAds.initializeSDK` | `APSSPInitializationSettings` + `APSSPAds.initializeSDK` |

{% tabs %}
{% tab title="기존 (ObjC SDK)" %}

```objc
#import <AdPopcornSSP/AdPopcornSSP.h>

[AdPopcornSSP initializeSDK:@"YOUR_APP_KEY"];
[AdPopcornSSP setLogLevel:AdPopcornSSPLogAll];
[AdPopcornSSP setUserId:@"TEST_USN"];
```

{% endtab %}

{% tab title="신규 — Objective-C" %}

```objc
@import APSSPSDK;

APSSPInitializationSettings *settings = [[APSSPInitializationSettings alloc] initWithAppKey:@"YOUR_APP_KEY"];
settings.logType = APSSPLogTypeAll;

[APSSPAds initializeSDKWith:settings completion:^{
    // 초기화 완료
}];

[APSSPAds setUSerIDWithUsn:@"TEST_USN"];
```

{% endtab %}

{% tab title="신규 — Swift" %}

```swift
import APSSPSDK

let settings = APSSPInitializationSettings(appKey: "YOUR_APP_KEY")
settings.logType = .all

APSSPAds.initializeSDK(with: settings) {
    // 초기화 완료
}

APSSPAds.setUSerID(usn: "TEST_USN")
```

{% endtab %}
{% endtabs %}

**주요 차이:**

* `AdPopcornSSP` 클래스 → `APSSPAds` 클래스
* 개별 설정 메서드 → `APSSPInitializationSettings` 객체로 통합
* 초기화 완료 콜백 추가 (미디에이션 SDK 자동 초기화 포함)

***

## 4. 클래스명 변경

| 기존 (ObjC SDK)                        | 신규 (Swift SDK)                |
| ------------------------------------ | ----------------------------- |
| `AdPopcornSSP`                       | `APSSPAds`                    |
| `AdPopcornSSPBannerView`             | `APSSPBannerView`             |
| `AdPopcornSSPInterstitialAd`         | `APSSPInterstitialAd`         |
| `AdPopcornSSPInterstitialVideoAd`    | `APSSPInterstitialVideoAd`    |
| `AdPopcornSSPRewardVideoAd`          | `APSSPRewardVideoAd`          |
| `AdPopcornSSPVideoMixAd`             | `APSSPVideoMixAd`             |
| `AdPopcornSSPNativeAd`               | `APSSPNativeAd`               |
| `AdPopcornSSPReactNativeAd`          | `APSSPReactNativeAd`          |
| `AdPopcornSSPModalAd`                | `APSSPModalAd`                |
| `AdPopcornSSPSplashAd`               | `APSSPSplashAd`               |
| `AdPopcornSSPContentsAd`             | `APSSPContentsAd`             |
| `AdPopcornSSPPopContentsAd`          | `APSSPPopContentsAd`          |
| `AdPopcornSSPRewardAdPlus`           | `APSSPRewardAdPlus`           |
| `AdPopcornSSPError`                  | `APSSPNetworkError` (enum)    |
| `AdPopcornSSPWKScriptMessageHandler` | `APSSPWKScriptMessageHandler` |

***

## 5. 광고 포맷별 API 변경

### 5-1. 배너 광고

<table><thead><tr><th width="121.90802001953125">항목</th><th width="294.7708740234375">기존</th><th>신규</th></tr></thead><tbody><tr><td>생성</td><td><code>initWithFrame:Key:placementId:size:viewController:</code></td><td><code>initWithAppKey:placementId:bannerSize:</code></td></tr><tr><td>로드</td><td><code>loadRequest</code></td><td><code>loadAd</code></td></tr><tr><td>중단</td><td><code>stopAd</code></td><td><code>stopAd</code></td></tr><tr><td>사이즈</td><td><code>SSPBannerSize320x50</code> (int)</td><td><code>APSSPBannerSizeBanner320x50</code> (enum)</td></tr><tr><td>delegate</td><td><code>AdPopcornSSPBannerViewDelegate</code></td><td><code>APSSPBannerViewDelegate</code></td></tr></tbody></table>

{% tabs %}
{% tab title="기존 (ObjC SDK)" %}

```objc
#import <AdPopcornSSP/AdPopcornSSPBannerView.h>

AdPopcornSSPBannerView *banner = [[AdPopcornSSPBannerView alloc] initWithFrame:frame
                                                                           Key:@"APP_KEY"
                                                                   placementId:@"PLACEMENT_ID"
                                                                          size:SSPBannerSize320x50
                                                                viewController:self];
banner.delegate = self;
[banner loadRequest];
```

{% endtab %}

{% tab title="신규 — Objective-C" %}

```objc
@import APSSPSDK;

APSSPBannerView *banner = [[APSSPBannerView alloc] initWithAppKey:@"APP_KEY"
                                                      placementId:@"PLACEMENT_ID"
                                                       bannerSize:APSSPBannerSizeBanner320x50];
banner.delegate = self;
banner.rootViewController = self;
[self.view addSubview:banner];
[banner loadAd];
```

{% endtab %}

{% tab title="신규 — Swift" %}

```swift
import APSSPSDK

let banner = APSSPBannerView(appKey: "APP_KEY", placementId: "PLACEMENT_ID", bannerSize: .banner320x50)
banner.delegate = self
banner.rootViewController = self
view.addSubview(banner)
banner.loadAd()
```

{% endtab %}
{% endtabs %}

### 5-2. 전면 광고

<table><thead><tr><th width="121.986083984375">항목</th><th width="321.6033935546875">기존</th><th>신규</th></tr></thead><tbody><tr><td>생성</td><td><code>initWithKey:placementId:viewController:</code></td><td><code>initWithAppKey:placementId:rootViewController:</code></td></tr><tr><td>로드</td><td><code>loadRequest</code></td><td><code>load</code></td></tr><tr><td>노출</td><td><code>presentFromViewController:</code></td><td><code>presentFrom:</code></td></tr><tr><td>delegate</td><td><code>AdPopcornSSPInterstitialAdDelegate</code></td><td><code>APSSPInterstitialAdDelegate</code></td></tr></tbody></table>

{% tabs %}
{% tab title="기존 (ObjC SDK)" %}

```objc
#import <AdPopcornSSP/AdPopcornSSPInterstitialAd.h>

AdPopcornSSPInterstitialAd *ad = [[AdPopcornSSPInterstitialAd alloc] initWithKey:@"APP_KEY"
                                                                     placementId:@"PLACEMENT_ID"
                                                                  viewController:self];
ad.delegate = self;
[ad loadRequest];
// 로드 성공 후
[ad presentFromViewController:self];
```

{% endtab %}

{% tab title="신규 — Objective-C" %}

```objc
@import APSSPSDK;

APSSPInterstitialAd *ad = [[APSSPInterstitialAd alloc] initWithAppKey:@"APP_KEY"
                                                          placementId:@"PLACEMENT_ID"
                                                   rootViewController:self];
ad.delegate = self;
[ad load];
// 로드 성공 후
[ad presentFrom:self];
```

{% endtab %}

{% tab title="신규 — Swift" %}

```swift
import APSSPSDK

let ad = APSSPInterstitialAd(appKey: "APP_KEY", placementId: "PLACEMENT_ID", rootViewController: self)
ad.delegate = self
ad.load()
// 로드 성공 후
ad.present(from: self)
```

{% endtab %}
{% endtabs %}

### 5-3. 전면 비디오 / 리워드 비디오 / 비디오 믹스

패턴 동일:

<table><thead><tr><th width="110.267333984375">항목</th><th>기존</th><th>신규</th></tr></thead><tbody><tr><td>생성</td><td><code>initWithKey:placementId:viewController:</code></td><td><code>initWithAppKey:placementId:rootViewController:</code></td></tr><tr><td>로드</td><td><code>loadRequest</code></td><td><code>load</code></td></tr><tr><td>노출</td><td><code>presentFromViewController:</code></td><td><code>presentFrom:</code></td></tr><tr><td>중단</td><td><code>stopAd</code></td><td><code>stopAd</code></td></tr></tbody></table>

{% tabs %}
{% tab title="기존 (ObjC SDK) — 리워드 비디오 예시" %}

```objc
#import <AdPopcornSSP/AdPopcornSSPRewardVideoAd.h>

AdPopcornSSPRewardVideoAd *rv = [[AdPopcornSSPRewardVideoAd alloc] initWithKey:@"APP_KEY"
                                                                   placementId:@"PLACEMENT_ID"
                                                                viewController:self];
rv.delegate = self;
[rv loadRequest];
// 로드 성공 후
[rv presentFromViewController:self];
```

{% endtab %}

{% tab title="신규 — Objective-C" %}

```objc
@import APSSPSDK;

APSSPRewardVideoAd *rv = [[APSSPRewardVideoAd alloc] initWithAppKey:@"APP_KEY"
                                                         placementId:@"PLACEMENT_ID"
                                                  rootViewController:self];
rv.delegate = self;
[rv load];
// 로드 성공 후
[rv presentFrom:self];
```

{% endtab %}

{% tab title="신규 — Swift" %}

```swift
import APSSPSDK

let rv = APSSPRewardVideoAd(appKey: "APP_KEY", placementId: "PLACEMENT_ID", rootViewController: self)
rv.delegate = self
rv.load()
// 로드 성공 후
rv.present(from: self)
```

{% endtab %}
{% endtabs %}

> 전면 비디오(`APSSPInterstitialVideoAd`), 비디오 믹스(`APSSPVideoMixAd`)도 동일한 패턴입니다.

### 5-4. 네이티브 광고

<table><thead><tr><th width="176.990478515625">항목</th><th>기존</th><th>신규</th></tr></thead><tbody><tr><td>생성</td><td><code>initWithFrame:Key:placementId:viewController:</code></td><td><code>initWithAppKey:placementId:rootViewController:</code></td></tr><tr><td>로드</td><td><code>loadRequest</code></td><td><code>load</code></td></tr><tr><td>중단</td><td><code>stopAd</code></td><td><code>stop</code></td></tr><tr><td>Renderer 설정</td><td><code>setApSSPRenderer:superView:</code></td><td><code>bindAdPopcornRenderer(adPopcornRender:)</code></td></tr><tr><td>AdMob Renderer</td><td><code>setAdMobRenderer:superView:</code></td><td><code>bindAdMobRenderer(renderer:)</code></td></tr><tr><td>NAM Renderer</td><td><code>setNAMRenderer:superView:</code></td><td><code>bindNamRenderer(renderer:)</code></td></tr></tbody></table>

{% tabs %}
{% tab title="기존 (ObjC SDK)" %}

```objc
#import <AdPopcornSSP/AdPopcornSSPNativeAd.h>

AdPopcornSSPNativeAd *nativeAd = [[AdPopcornSSPNativeAd alloc] initWithFrame:frame
                                                                         Key:@"APP_KEY"
                                                                 placementId:@"PLACEMENT_ID"
                                                              viewController:self];
nativeAd.delegate = self;

APSSPNativeAdRenderer *renderer = [[APSSPNativeAdRenderer alloc] init];
renderer.titleLabel = _titleLabel;
renderer.descLabel = _descLabel;
renderer.mainImageView = _mainImageView;
[nativeAd setApSSPRenderer:renderer superView:_nativeAdView];

[nativeAd loadRequest];
```

{% endtab %}

{% tab title="신규 — Objective-C" %}

```objc
@import APSSPSDK;

APSSPNativeAd *nativeAd = [[APSSPNativeAd alloc] initWithAppKey:@"APP_KEY"
                                                    placementId:@"PLACEMENT_ID"
                                             rootViewController:nil];
nativeAd.delegate = self;
[self.view addSubview:nativeAd];

APSSPNativeAdRenderer *renderer = [[APSSPNativeAdRenderer alloc] init];
renderer.titleLabel = _titleLabel;
renderer.descLabel = _descLabel;
renderer.mainImageView = _mainImageView;
[nativeAd bindAdPopcornRendererWithAdPopcornRender:renderer];

[nativeAd load];
```

{% endtab %}

{% tab title="신규 — Swift" %}

```swift
import APSSPSDK

let nativeAd = APSSPNativeAd(appKey: "APP_KEY", placementId: "PLACEMENT_ID")
nativeAd.delegate = self
view.addSubview(nativeAd)

let renderer = APSSPNativeAdRenderer()
renderer.titleLabel = titleLabel
renderer.descLabel = descLabel
renderer.mainImageView = mainImageView
nativeAd.bindAdPopcornRenderer(adPopcornRender: renderer)

nativeAd.load()
```

{% endtab %}
{% endtabs %}

### 5-5. 모달 광고

<table><thead><tr><th width="106.400146484375">항목</th><th>기존</th><th>신규</th></tr></thead><tbody><tr><td>생성</td><td><code>initWithKey:placementId:viewController:</code></td><td><code>initWithAppKey:placementId:viewController:</code></td></tr><tr><td>로드</td><td><code>loadRequest</code></td><td><code>loadRequest</code></td></tr><tr><td>노출</td><td><code>presentFromViewController:</code></td><td><code>presentFrom:</code></td></tr></tbody></table>

### 5-6. 스플래시 광고

<table><thead><tr><th width="102.5980224609375">항목</th><th>기존</th><th>신규</th></tr></thead><tbody><tr><td>생성</td><td><code>initWithFrame:Key:placementId:viewController:</code></td><td><code>initWithFrame:appKey:placementId:viewController:</code></td></tr><tr><td>로드</td><td><code>loadRequest</code></td><td><code>loadRequest</code></td></tr><tr><td>중단</td><td><code>stopAd</code></td><td><code>stopAd</code></td></tr></tbody></table>

### 5-7. 보상형 광고 플러스

<table><thead><tr><th width="106.11798095703125">항목</th><th>기존</th><th>신규</th></tr></thead><tbody><tr><td>열기</td><td><code>[AdPopcornSSP openRewardPlusSettingViewController:appKey viewController:]</code></td><td><code>[APSSPRewardAdPlus openRewardAdPlusViewControllerWithAppKey:viewController:]</code></td></tr></tbody></table>

***

## 6. Delegate 메서드명 변경

> Swift SDK는 Swift 스타일 네이밍을 사용하므로, ObjC에서 호출 시 자동 변환된 이름을 사용합니다.

### 배너

<table><thead><tr><th width="320.953125">기존</th><th>신규 (ObjC에서 사용 시)</th></tr></thead><tbody><tr><td><code>APSSPBannerViewLoadSuccess:</code></td><td><code>apsspBannerViewLoadSuccessWithBannerView:</code></td></tr><tr><td><code>APSSPBannerViewLoadFail:error:</code></td><td><code>apsspBannerViewLoadFailWithBannerView:error:</code></td></tr><tr><td><code>APSSPBannerViewClicked:</code></td><td><code>apsspBannerViewClickedWithBannerView:</code></td></tr></tbody></table>

{% tabs %}
{% tab title="기존 (ObjC SDK)" %}

```objc
- (void)APSSPBannerViewLoadSuccess:(AdPopcornSSPBannerView *)bannerView {
}
- (void)APSSPBannerViewLoadFail:(AdPopcornSSPBannerView *)bannerView error:(AdPopcornSSPError *)error {
}
```

{% endtab %}

{% tab title="신규 — Objective-C" %}

```objc
- (void)apsspBannerViewLoadSuccessWithBannerView:(APSSPBannerView *)bannerView {
}
- (void)apsspBannerViewLoadFailWithBannerView:(APSSPBannerView *)bannerView error:(enum APSSPNetworkError)error {
}
- (void)apsspBannerViewClickedWithBannerView:(APSSPBannerView *)bannerView {
}
- (void)apsspBannerViewImpressionWithBannerView:(APSSPBannerView *)bannerView {
}
```

{% endtab %}

{% tab title="신규 — Swift" %}

```swift
func apsspBannerViewLoadSuccess(bannerView: APSSPBannerView) {
}
func apsspBannerViewLoadFail(bannerView: APSSPBannerView, error: APSSPNetworkError) {
}
func apsspBannerViewClicked(bannerView: APSSPBannerView) {
}
func apsspBannerViewImpression(bannerView: APSSPBannerView) {
}
```

{% endtab %}
{% endtabs %}

### 전면

<table><thead><tr><th width="322.5546875">기존</th><th>신규 (ObjC에서 사용 시)</th></tr></thead><tbody><tr><td><code>APSSPInterstitialAdLoadSuccess:</code></td><td><code>apsspInterstitialAdLoadSuccessWithInterstitialAd:</code></td></tr><tr><td><code>APSSPInterstitialAdLoadFail:error:</code></td><td><code>apsspInterstitialAdLoadFailWithInterstitialAd:error:</code></td></tr><tr><td><code>APSSPInterstitialAdShowSuccess:</code></td><td><code>apsspInterstitialAdShowSuccessWithInterstitialAd:</code></td></tr><tr><td><code>APSSPInterstitialAdShowFail:</code></td><td><code>apsspInterstitialAdShowFailWithInterstitialAd:error:</code></td></tr><tr><td><code>APSSPInterstitialAdClicked:</code></td><td><code>apsspInterstitialAdClickedWithInterstitialAd:</code></td></tr><tr><td><code>APSSPInterstitialAdClosed:</code></td><td><code>apsspInterstitialAdClosedWithInterstitialAd:</code></td></tr></tbody></table>

{% tabs %}
{% tab title="기존 (ObjC SDK)" %}

```objc
- (void)APSSPInterstitialAdLoadSuccess:(AdPopcornSSPInterstitialAd *)interstitialAd {
    [interstitialAd presentFromViewController:self];
}
- (void)APSSPInterstitialAdLoadFail:(AdPopcornSSPInterstitialAd *)interstitialAd error:(AdPopcornSSPError *)error {
}
- (void)APSSPInterstitialAdClosed:(AdPopcornSSPInterstitialAd *)interstitialAd {
}
```

{% endtab %}

{% tab title="신규 — Objective-C" %}

```objc
- (void)apsspInterstitialAdLoadSuccessWithInterstitialAd:(APSSPInterstitialAd *)interstitialAd {
    [interstitialAd presentFrom:self];
}
- (void)apsspInterstitialAdLoadFailWithInterstitialAd:(APSSPInterstitialAd *)interstitialAd error:(enum APSSPNetworkError)error {
}
- (void)apsspInterstitialAdClosedWithInterstitialAd:(APSSPInterstitialAd *)interstitialAd {
}
```

{% endtab %}

{% tab title="신규 — Swift" %}

```swift
func apsspInterstitialAdLoadSuccess(interstitialAd: APSSPInterstitialAd) {
    interstitialAd.present(from: self)
}
func apsspInterstitialAdLoadFail(interstitialAd: APSSPInterstitialAd, error: APSSPNetworkError) {
}
func apsspInterstitialAdClosed(interstitialAd: APSSPInterstitialAd) {
}
```

{% endtab %}
{% endtabs %}

### 리워드 비디오

<table><thead><tr><th width="320.862060546875">기존</th><th>신규 (ObjC에서 사용 시)</th></tr></thead><tbody><tr><td><code>APSSPRewardVideoAdLoadSuccess:</code></td><td><code>apsspRewardVideoAdLoadSuccessWithRewardVideoAd:</code></td></tr><tr><td><code>APSSPRewardVideoAdLoadFail:error:</code></td><td><code>apsspRewardVideoAdLoadFailWithRewardVideoAd:error:</code></td></tr><tr><td><code>APSSPRewardVideoAdShowSuccess:</code></td><td><code>apsspRewardVideoAdShowSuccessWithRewardVideoAd:</code></td></tr><tr><td><code>APSSPRewardVideoAdShowFail:</code></td><td><code>apsspRewardVideoAdShowFailWithRewardVideoAd:error:</code></td></tr><tr><td><code>APSSPRewardVideoAdClosed:</code></td><td><code>apsspRewardVideoAdClosedWithRewardVideoAd:</code></td></tr><tr><td><code>APSSPRewardVideoAdPlayCompleted:adNetworkNo:completed:</code></td><td><code>apsspRewardVideoAdPlayCompletedWithRewardVideoAd:adNetworkNo:completed:</code></td></tr></tbody></table>

{% tabs %}
{% tab title="기존 (ObjC SDK)" %}

```objc
- (void)APSSPRewardVideoAdLoadSuccess:(AdPopcornSSPRewardVideoAd *)rewardVideoAd {
    [rewardVideoAd presentFromViewController:self];
}
- (void)APSSPRewardVideoAdPlayCompleted:(AdPopcornSSPRewardVideoAd *)rewardVideoAd adNetworkNo:(long)adNetworkNo completed:(BOOL)completed {
}
```

{% endtab %}

{% tab title="신규 — Objective-C" %}

```objc
- (void)apsspRewardVideoAdLoadSuccessWithRewardVideoAd:(APSSPRewardVideoAd *)rewardVideoAd {
    [rewardVideoAd presentFrom:self];
}
- (void)apsspRewardVideoAdPlayCompletedWithRewardVideoAd:(APSSPRewardVideoAd *)rewardVideoAd adNetworkNo:(NSInteger)adNetworkNo completed:(BOOL)completed {
}
```

{% endtab %}

{% tab title="신규 — Swift" %}

```swift
func apsspRewardVideoAdLoadSuccess(rewardVideoAd: APSSPRewardVideoAd) {
    rewardVideoAd.present(from: self)
}
func apsspRewardVideoAdPlayCompleted(rewardVideoAd: APSSPRewardVideoAd, adNetworkNo: Int, completed: Bool) {
}
```

{% endtab %}
{% endtabs %}

### 비디오 믹스

| 기존                                                    | 신규 (ObjC에서 사용 시)                                                    |
| ----------------------------------------------------- | ------------------------------------------------------------------- |
| `APSSPVideoMixAdLoadSuccess:videoMixAdType:`          | `apsspVideoMixAdLoadSuccessWithVideoMixAd:videoMixAdType:`          |
| `APSSPVideoMixAdLoadFail:error:`                      | `apsspVideoMixAdLoadFailWithVideoMixAd:error:`                      |
| `APSSPVideoMixAdClosed:videoMixAdType:`               | `apsspVideoMixAdClosedWithVideoMixAd:videoMixAdType:`               |
| `APSSPVideoMixAdPlayCompleted:adNetworkNo:completed:` | `apsspVideoMixAdPlayCompletedWithVideoMixAd:adNetworkNo:completed:` |

{% tabs %}
{% tab title="기존 (ObjC SDK)" %}

```objc
- (void)APSSPVideoMixAdLoadSuccess:(AdPopcornSSPVideoMixAd *)videoMixAd videoMixAdType:(int)type {
    [videoMixAd presentFromViewController:self];
}
```

{% endtab %}

{% tab title="신규 — Objective-C" %}

```objc
- (void)apsspVideoMixAdLoadSuccessWithVideoMixAd:(APSSPVideoMixAd *)videoMixAd videoMixAdType:(enum APSSPVideoMixAdType)videoMixAdType {
    [videoMixAd presentFrom:self];
}
```

{% endtab %}
{% endtabs %}

### 네이티브

<table><thead><tr><th width="315.3802490234375">기존</th><th>신규 (ObjC에서 사용 시)</th></tr></thead><tbody><tr><td><code>APSSPNativeAdLoadSuccess:</code></td><td><code>apsspNativeAdLoadSuccessWithNativeAdView:</code></td></tr><tr><td><code>APSSPNativeAdLoadFail:error:</code></td><td><code>apsspNativeAdLoadFailWithNativeAdView:error:</code></td></tr><tr><td><code>APSSPNativeAdImpression:</code></td><td><code>apsspNativeAdImpressionWithNativeAd:</code></td></tr><tr><td><code>APSSPNativeAdClicked:</code></td><td><code>apsspNativeAdClickedWithNativeAd:</code></td></tr><tr><td><code>APSSPNativeAdHidden:</code></td><td><code>apsspNativeAdHiddenWithNativeAd:</code></td></tr></tbody></table>

{% tabs %}
{% tab title="기존 (ObjC SDK)" %}

```objc
- (void)APSSPNativeAdLoadSuccess:(AdPopcornSSPNativeAd *)nativeAd {
}
- (void)APSSPNativeAdLoadFail:(AdPopcornSSPNativeAd *)nativeAd error:(AdPopcornSSPError *)error {
}
```

{% endtab %}

{% tab title="신규 — Objective-C" %}

```objc
- (void)apsspNativeAdLoadSuccessWithNativeAdView:(APSSPNativeAd *)nativeAdView {
}
- (void)apsspNativeAdLoadFailWithNativeAdView:(APSSPNativeAd *)nativeAdView error:(enum APSSPNetworkError)error {
}
```

{% endtab %}
{% endtabs %}

***

## 7. 설정 API 변경

| 기존                                                                     | 신규 (ObjC)                                                           | 신규 (Swift)                                                        |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------- |
| `[AdPopcornSSP setUserId:@"USN"]`                                      | `[APSSPAds setUSerIDWithUsn:@"USN"]`                                | `APSSPAds.setUSerID(usn: "USN")`                                  |
| `[AdPopcornSSP setLogLevel:AdPopcornSSPLogAll]`                        | `settings.logType = APSSPLogTypeAll`                                | `settings.logType = .all`                                         |
| `[AdPopcornSSP tagForChildDirectedTreatment:YES]`                      | `[APSSPAds tagForChildDirectedTreatment:YES]`                       | `APSSPAds.tagForChildDirectedTreatment(true)`                     |
| `[AdPopcornSSP setUIDIdentifier:0 identifier:@"email"]`                | `[APSSPAds setUIDIdentifierWithIdentityType:0 identifier:@"email"]` | `APSSPAds.setUIDIdentifier(identityType: 0, identifier: "email")` |
| `[AdPopcornSSP gdprConsentAvailable:YES]`                              | (3.1.1에서 추가 예정)                                                     | (3.1.1에서 추가 예정)                                                   |
| `[AdPopcornSSP setAdInspectorEnabled:YES]`                             | `settings.adInspectorEnabled = YES`                                 | `settings.adInspectorEnabled = true`                              |
| `[AdPopcornSSP openCSViewController:self appKey:@"KEY" userId:@"USN"]` | `[APSSPAds presentCSViewController:self userID:@"USN"]`             | `APSSPAds.presentCSViewController(self, userID: "USN")`           |

***

## 8. Enum 변경

### 배너 사이즈

<table><thead><tr><th width="294.0867919921875">기존</th><th>신규</th></tr></thead><tbody><tr><td><code>SSPBannerSize320x50</code> (int 0)</td><td><code>APSSPBannerSizeBanner320x50</code> (rawValue 1)</td></tr><tr><td><code>SSPBannerSize300x250</code> (int 1)</td><td><code>APSSPBannerSizeBanner300x250</code> (rawValue 2)</td></tr><tr><td><code>SSPBannerSize320x100</code> (int 2)</td><td><code>APSSPBannerSizeBanner320x100</code> (rawValue 3)</td></tr></tbody></table>

{% hint style="warning" %}
rawValue가 변경되었습니다. 숫자로 직접 지정하지 말고 enum 이름을 사용하세요.
{% endhint %}

### 에러 타입

<table><thead><tr><th width="348.006103515625">기존</th><th>신규</th></tr></thead><tbody><tr><td><code>AdPopcornSSPError *error</code> (NSError 기반)</td><td><code>APSSPNetworkError</code> (enum, rawValue = 에러코드)</td></tr><tr><td><code>error.code</code></td><td><code>error</code> 자체가 에러코드 enum</td></tr></tbody></table>

### 로그 레벨

<table><thead><tr><th width="355.067626953125">기존</th><th>신규</th></tr></thead><tbody><tr><td><code>AdPopcornSSPLogAll</code></td><td><code>APSSPLogTypeAll</code></td></tr><tr><td><code>AdPopcornSSPLogNone</code></td><td><code>APSSPLogTypeNone</code></td></tr></tbody></table>

### VideoMix 타입

| 기존                 | 신규                         |
| ------------------ | -------------------------- |
| `int type` (2/4/6) | `APSSPVideoMixAdType` enum |

***

## 9. 미디에이션 Adapter 변경

### 기존 방식

* 수동으로 adapter `.m/.h` 파일을 프로젝트에 추가
* 각 업체 SDK를 별도로 Pod 설치
* `#import` 전환 (로컬 → framework) 필요

### 신규 방식

* `pod 'APSSPMediationAdMob'` 한 줄로 adapter + 3rd party SDK 자동 설치
* adapter 소스가 Pod에 포함되어 있어 별도 파일 추가 불필요
* `APSSPAdapterRegistry`가 설치된 adapter를 자동 탐색

### 네이티브 Renderer 변경

| 기존                                      | 신규                                   |
| --------------------------------------- | ------------------------------------ |
| `setAdMobRenderer:superView:`           | `bindAdMobRenderer(renderer:)`       |
| `setNAMRenderer:superView:`             | `bindNamRenderer(renderer:)`         |
| `setAdFitRenderer:superView:`           | `bindAdfitRenderer(renderer:)`       |
| `setAppLovinMaxRenderer:superView:`     | `bindApplovinMaxRenderer(renderer:)` |
| `setVungleRenderer:superView:`          | `bindVungleRenderer(renderer:)`      |
| `setFANNativeRenderer:superView:`       | `bindFBANNativeRenderer(renderer:)`  |
| `setMintegralNativeRenderer:superView:` | `bindMintegralRenderer(renderer:)`   |
| `setInMobiRenderer:superView:`          | `bindInMobiRenderer(renderer:)`      |
| `setFyberRenderer:superView:`           | `bindFyberRenderer(renderer:)`       |
| `setADOPRenderer:superView:`            | `bindAdopRenderer(renderer:)`        |
| `setGAMRenderer:superView:`             | `bindGamRenderer(renderer:)`         |
| `setAdForusRenderer:superView:`         | `bindAdForusRenderer(renderer:)`     |

> 신규 SDK에서는 `superView:` 파라미터가 제거되었습니다. APSSPNativeAd 자체가 UIView이므로 별도 superView 지정이 불필요합니다.

***

## 10. 삭제된 API

<table><thead><tr><th width="349.963623046875">기존 API</th><th>상태</th></tr></thead><tbody><tr><td><code>setManualMediationSchedule:</code></td><td>제거 (서버 스케줄만 사용)</td></tr><tr><td><code>getCurrentNetwork</code></td><td>제거</td></tr><tr><td><code>isReady</code></td><td>제거 (delegate 콜백으로 대체)</td></tr><tr><td><code>getSDKVersion</code> / <code>getSDKVersionNum</code></td><td><code>APSSPAds.sdkVersion()</code> 으로 통합</td></tr><tr><td><code>frameworkName</code></td><td>제거</td></tr></tbody></table>

***

## 11. 하이브리드 브릿지 변경

<table><thead><tr><th width="169.0650634765625">항목</th><th width="318.0321044921875">기존</th><th>신규</th></tr></thead><tbody><tr><td>클래스</td><td><code>AdPopcornSSPWKScriptMessageHandler</code></td><td><code>APSSPWKScriptMessageHandler</code></td></tr><tr><td>JS handler 이름</td><td><code>AdPopcornSSP</code></td><td><code>APSSPSDK</code></td></tr></tbody></table>

JS 호출 코드도 변경 필요:

```javascript
// 기존
window.webkit.messageHandlers.AdPopcornSSP.postMessage(...)

// 신규
window.webkit.messageHandlers.APSSPSDK.postMessage(...)
```


---

# 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/ios/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.
