BuzzAd-Benefit iOS SDK ์ฐ๋ ๊ฐ์ด๋
๋ณธ ์ฐ๋ ๊ฐ์ด๋๋ BuzzAd-Benefit SDK๋ฅผ iOS Application ๋ด์ ์ฝ์ ํจ์ผ๋ก์จ ํผ๋ธ๋ฆฌ์ ๊ฐ ์ํ๋ ์ง๋ฉด์ ๋ฆฌ์๋๊ฐ ์ง๊ธ๋๋ ๊ด๊ณ ๋ฅผ ๋์ฐ๊ธฐ ์ํจ์ ๋๋ค. ๋ค์ดํฐ๋ธ ๊ด๊ณ ์ ๋์์ ๊ด๊ณ ๋ฅผ ์ง์ํ๋ฉฐ, ์ปค์คํ UI ์์๋ฅผ ํตํด ๊ด๊ณ ๊ฐ ํผ๋ธ๋ฆฌ์ ์ฑ์ ์์ฐ์ค๋ฝ๊ฒ ๋ น์๋ค๊ฒ ํ๋ฉด์ ๋์์ ๋งค์ถ์ ๊ทน๋ํํ ์ ์์ต๋๋ค.
Index
Getting Started
SDK๋ฅผ ์ฑ์ ์ฐ๋ํ๊ธฐ ์ , ์๋ ์ฌํญ์ ๋จผ์ ์ค๋นํด์ผ ํฉ๋๋ค.
Buzzvil์ BD ๋งค๋์ ๋ฅผ ํตํด ์ ๋ฌ๋ฐ์ app_id
BD ๋งค๋์ ๋ฅผ ํตํด ์ ๋ฌ๋ฐ์ unit_id (์ํ๋ Type ์ ๋ง๋ unit_id ์๋ น)
Type A - Native Ads ์ ์ฉ ์
YOUR_NATIVE_AD_UNIT_ID
์ค๋นType B - Feed ์ ์ฉ ์
YOUR_FEED_UNIT_ID
์ค๋นType C - Interstitial ์ ์ฉ ์
YOUR_INTERSTITIAL_UNIT_ID
์ค๋น
Buzzvil ์๋ฒ๋ก๋ถํฐ ํฌ์ธํธ ์ ๋ฆฝ ์์ฒญ์ ๋ฐ์ ์ ์๋ ๋งค์ฒด์ฌ API ์๋ฒ
Postback ์์ url ์ธํ ํ Buzzvil BD ๋งค๋์ (์ด์ ๋งค๋์ )์๊ฒ ์ ๋ฌ
ย
Installation
๋ค์ ์ํ ์ฝ๋๋ฅผ ํตํด, ์ค์ ๊ตฌํ์ ์ฌ์ฉ๋ ์์ ๋ฅผ ์ฐธ๊ณ ํ ์ ์์ต๋๋ค: github sample code (๋งํฌ)
1. Cocoapods ์ฌ์ฉ (๊ถ์ฅ)
Podfile
์ ์๋ ์ฝ๋ ์ถ๊ฐ
pod 'BuzzAdBenefit', '์ฐ๋ํ๋ ค๋ ๋ฒ์ '
์ ์ ๋ ฅํด ์ฃผ์ธ์.
pod 'BuzzAdBenefit', '~> 1.3.0'
ย
2. Manual Import
cocoa pods ๋ฅผ ์ฌ์ฉํ์ง ์์ ๊ฒฝ์ฐ ์๋์ ๋ฐฉ๋ฒ์ผ๋ก ์งํ ๊ฐ๋ฅํฉ๋๋ค.
step 1) ํ๋ก์ ํธ์ framework ์ถ๊ฐ
[ํ๋ก์ ํธ ๋ฉ๋ด] -> [General] -> [Embedded Binaries] ์น์ ์ ๋ค์ framework๋ค์ ์ถ๊ฐํฉ๋๋ค.
BuzzAdBenefit.framework
BuzzAdBenefitNative.framework
BuzzAdBenefitInterstitial.framework (Interstitial type์ ์ฌ์ฉํ ๊ฒฝ์ฐ)
BuzzAdBenefitFeed.framework (Feed type์ ์ฌ์ฉํ ๊ฒฝ์ฐ)
AFNetworking.framework
SDWebImage.framework
libwebp.framework
(AFNetworking.framework, SDWebImage.framework, libwebp.framework๋ ๋ณธ ์ ์ฅ์ Dependencies ํด๋์์ ๋ค์ด๋ฐ์ ์ ์์ต๋๋ค.)
ย
step 2) Run script ์ถ๊ฐ
[ํ๋ก์ ํธ ๋ฉ๋ด] -> [Build Phases] ํญ์์ '+' ๋ฒํผ์ ๋๋ฌ New Run Script Phase๋ฅผ ์ถ๊ฐํ๊ณ ์๋ ์คํฌ๋ฆฝํธ๋ฅผ ๋ถ์ฌ ๋ฃ์ต๋๋ค. ์ด ๊ณผ์ ์ universal framework๋ก ๋น๋๋ ๋ฐ์ด๋๋ฆฌ์์ ๋ถํ์ํ architecture๋ค์ ๋ผ์ด๋ด๊ธฐ ์ํด ํ์ํฉ๋๋ค.
ย
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK; do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS; do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done
ย
SDK Initialization
Step 1: Initialize BuzzAdBenefit
AppDelegate์ application:didFinishLaunchingWithOptions
์ ์๋ ์ฝ๋๋ฅผ ์ถ๊ฐํ ๊ฒ์ ๊ถ์ฅํ๋, ์ต์ด ๊ด๊ณ ์์ฒญ ์ ์๋ง ๋ถ๋ฆฐ๋ค๋ฉด ์์ ๋กญ๊ฒ ์ฝ๋ ์์น๋ฅผ ๊ฒฐ์ ํ ์ ์์ต๋๋ค.
YOUR_APP_ID ๋ถ๋ถ์ ์ ๋จ๊ณ์์ ์ค๋นํ app_id ์ฝ์
// Objective-C
BABConfig *config = [[BABConfig alloc] initWithAppId:YOUR_APP_ID];
[BuzzAdBenefit initializeWithConfig:config];
ย
// Swift
let config = BABConfig(appId: YOUR_APP_ID)
BuzzAdBenefit.initialize(with: config)
ย
Step 2: Set UserProfile
of the user
์ ์ ๊ฐ ํผ๋ธ๋ฆฌ์
์ฑ์ ๋ก๊ทธ์ธํ ์์ ์ ์๋์ ๊ฐ์ด UserProfile
์ ์ธํ
ํฉ๋๋ค.
โป ์ฃผ์์ฌํญ
User ID์ ํ๊ฒํ ์ ๋ณด (์ฑ๋ณ, ์ฐ๋ น)๋ ์ํํ ์๋น์ค ์ด์์ ์ํด ์ ๊ณตํด์ผ ํ ํ์ ํญ๋ชฉ์ ๋๋ค. ํด๋น ๊ฐ์ ์ ๋ ฅํ๋
setUserProfile
ํจ์๊ฐ ํธ์ถ๋์ง ์์ผ๋ฉด ๊ด๊ณ ๊ฐ ํ ๋น๋์ง ์์ต๋๋ค
userId (Required): ๋งค์ฒด์ฌ ์๋น์ค ์ ์ ๋ฅผ unique ํ๊ฒ ๊ตฌ๋ถํ ์ ์๋ ์๋ณ๊ฐ
๋งค์ฒด์ฌ ์๋น์ค์์ ์ ๋ํฌํ๋ค๊ณ ํ๋จ๋๋ ์ ์ ์ ๋ํ์ฌ, userId ๊ฐ์ด ๋ณต์ ๊ฐ ์ฐ๋๋๊ฑฐ๋ ๋ณ๊ฒฝ๋ ๊ฐ๋ฅ์ฑ์ด ์์ ๊ฒฝ์ฐ ์ฌ์ ์ BD ๋งค๋์ ์ ๋ ผ์ํด์ผ ํฉ๋๋ค.
์: ๋งค์ฒด์ฌ ์ฑ ์ญ์ ํ ์ฌ์ค์น ์ userId ๊ฐ์ด ๋ณ๊ฒฝ๋๋ ๊ฒฝ์ฐ
gender
BABUserGenderMale
: ๋จ์ฑBABUserGenderFemale
: ์ฌ์ฑ
birthYear: ์ถ์๋ ๋
// Objective-C
BABUserProfile *userProfile = [[BABUserProfile alloc] initWithUserId:YOUR_SERVICE_USER_ID birthYear:1985 gender:BABUserGenderMale];
[BuzzAdBenefit setUserProfile:userProfile];
// Swift
let userProfile = BABUserProfile(userId: YOUR_SERVICE_USER_ID, birthYear: 1985, gender: BABUserGenderMale)
BuzzAdBenefit.setUserProfile(userProfile)
ย
โป ์ฃผ์์ฌํญ
Step 1, 2๋ฅผ ํตํด ์ธ์ ํค ๋ฑ๋ก์ด ์๋ฃ๋๋ฉด
BABSessionRegisteredNotification
notification์ด ํธ์ถ๋ฉ๋๋ค. ์ธ์ ํค๋ SDK๊ฐ ๊ด๊ณ ๋ฅผ ์์ฒญํ๊ณ ๋ฐ์์ค๊ธฐ ์ํด์ ํ์ํ ์๋ฒ API Key๋ก์ ์ธ์ ํค๊ฐ ์๋ ๊ฒฝ์ฐ ๊ด๊ณ ๋ก๋๊ฐ ๋ถ๊ฐ๋ฅํฉ๋๋ค.Step 2 ์ ๊ด๊ณ ์์ฒญ ์์ ๊ฐ ๊ฐ๊ฒฉ์ด ์งง์ ๊ฒฝ์ฐ ์ด notification์ observeํ์ฌ ์ธ์ ํค ๋ฑ๋ก์ ํ์ธํ ํ ๊ด๊ณ ์์ฒญ์ ์ํํ ์ ์์ต๋๋ค.
ย
// Objective-C
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadBABAd) name:BABSessionRegisteredNotification object:nil];
// Swift
NotificationCenter.default.addObserver(self, selector: #selector(loadBABAd), name: NSNotification.Name.BABSessionRegistered, object: nil)
ย
iOS 14 ์ด์์์ ์ฌ์ฉ์์๊ฒ App Tracking Transparency ๊ถํ ํ์ฉ ํ์
์ ๋
ธ์ถํ๋ ค๋ฉด setUserProfile
์ ์ธ์๋ก shouldShowAppTrackingTransparencyDialog
๊ฐ์ true๋ก ํ์ฌ ํธ์ถํ๋ฉด ๋ฉ๋๋ค(SDK 1.3.3 ์ด์). ๊ทธ๋ฆฌ๊ณ ์ฑ์ info.plist ํ์ผ์ NSUserTrackingUsageDescription
๊ฐ์ ์ถ๊ฐํ์ฌ ๊ถํ ํ์ฉ ํ์
์์ ์ฌ์ฉ์์๊ฒ ๋ณด์ฌ์ง ๋ฉ์ธ์ง๋ฅผ ๋ฃ์ด์ค๋๋ค.
ํด๋น ํ์ ์ ์์ง ๊ถํ ํ์ฉ ์ฌ๋ถ๋ฅผ ์ ํํ์ง ์์ ์ฌ์ฉ์์ ํํ์ฌ ์ต์ด 1ํ๋ง ๋ ธ์ถ๋ฉ๋๋ค.
Step 3: Set UserPreference
of the user
์ ์ ๊ฐ ํผ๋ธ๋ฆฌ์
์ฑ์ ๋ก๊ทธ์ธํ ์์ ์ UserPreference
๋ฅผ ๋น๋ํ์ฌ BuzzAdBenefit SDK์ ํด๋น ๊ฐ์ ์ธํ
ํฉ๋๋ค.
autoplayType: ๋์์ ๊ด๊ณ ์ ๋ํ ์๋์ฌ์ ์ต์ ์ ์ค์ ํฉ๋๋ค.
AutoplayType
์ ์ค์ ๊ฐ์ ์๋์ ๊ฐ์ต๋๋ค.BABVideoAutoPlayEnabled
: ๋์์ ๊ด๊ณ ๊ฐ Wifi, LTE ํ๊ฒฝ ๋ชจ๋์์ ํญ์ ์๋์ฌ์๋จBABVideoAutoPlayOnWifi
: ๋์์ ๊ด๊ณ ๊ฐ Wifi ๋คํธ์ํฌ ํ๊ฒฝ์์๋ง ์๋์ฌ์๋จ (Default)BABVideoAutoPlayDisabled
: ๋์์ ๊ด๊ณ ๊ฐ ์๋์ฌ์๋์ง ์์
// Objective-C
BABUserPreference *userPreference = [[BABUserPreference alloc] initWithAutoPlayType:BABVideoAutoPlayEnabled];
[BuzzAdBenefit setUserPreference:userPreference];
ย
// Swift
let userPreference = BABUserPreference(autoPlayType: BABVideoAutoPlayEnabled)
BuzzAdBenefit.setUserPreference(userPreference)
ย
Step 4. Delete user setting
์ ์ ๊ฐ ํผ๋ธ๋ฆฌ์
์ฑ์์ ๋ก๊ทธ์์ํ๋ ์์ ์ UserProfile
๋ฐ UserPreferences
์ค์ ๊ฐ์ ์ง์ ์ ์ ์ ์ฌ์ฉ ์ ๋ณด๋ฅผ ์ญ์ ํฉ๋๋ค.
// Objective-C
[BuzzAdBenefit setUserProfile:nil];
[BuzzAdBenefit setUserPreference:nil];
ย
// Swift
BuzzAdBenefit.setUserProfile(nil)
BuzzAdBenefit.setUserPreference(nil)
ย
Step 5. Proceed to the next step
BuzzAd Benefit ๊ด๊ณ ๋ฅผ ๋ ธ์ถ์ํฌ ๊ณต๊ฐ์ ์ ํฉํ ์ฐ๋ ํ์ ์ ์ ํํ์ฌ ๋๋จธ์ง ์ฐ๋์ ์งํํฉ๋๋ค.
Type A - Native Ads : ์ธ์ฑ ๋์์ธ๊ณผ ์์ฐ์ค๋ฝ๊ฒ ์ด์ฐ๋ฌ์ง๋๋ก ๊ด๊ณ ๋ฅผ ๋ ธ์ถ์ํค๊ณ ์ ํ๋ ๊ฒฝ์ฐ
Type B - Feed : ๋ฒํผ ๋ฑ ๋ณ๋์ ์ง์ ๊ฒฝ๋ก๋ฅผ ํตํด ๊ด๊ณ ๋ชฉ๋ก์ ๋ ธ์ถ์ํค๊ณ ์ ํ๋ ๊ฒฝ์ฐ
Type C - Interstitial : ๋ฒ์ฆ๋น์ด ์ฌ์ ์ ๋ง๋ค์ด ๋์ ๋ ์ด์์์ ํ์ฉํ์ฌ Dialog ๋๋ BottomSheet ํํ๋ก ์ ๋ฉด ๊ด๊ณ ๋ฅผ ๋ ธ์ถํ๊ณ ์ ํ๋ ๊ฒฝ์ฐ
ย
Advanced Usage
๊ด๊ณ ์คํ Customization - Custom Launcher ์ฌ์ฉ
๊ด๊ณ ์คํ์ Customize ํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด, ๊ด๊ณ ๋๋ฉ ํ์ด์ง ๋ก๋ ๋ฑ์ ๋งค์ฒด์ฌ๊ฐ ์ง์ ํ๋ Class์์ ๊ตฌํํ ์ ์์ต๋๋ค.
โป ์ฃผ์์ฌํญ
Launcher์์ ์ ๊ณตํ๋ ํด๋ฆญ URI๋ ์์๋ก Decoding ํด์ ๋ก๋ํ๋ฉด ์๋ฉ๋๋ค. ์ด ๊ฒฝ์ฐ ์๋ฒ์์์ ๋์์ด ๋ฌ๋ผ์ ธ ๊ด๊ณ ๊ด๋ จ ํต๊ณ๊ฐ ์ ๋๋ก ์ง๊ณ๋์ง ์์ ์ ์์ต๋๋ค.
BABLauncher
๋ฅผ ๊ตฌํํฉ๋๋ค.openUrl:object:userInfo
๋ฉ์๋์ ์ธ์๋ก ๋์ด์ค๋ object๋ BABAd ๋๋ BABArticle ๊ฐ์ฒด๋ฅผ ๋ด๊ณ ์์ต๋๋ค.// Objective-C @interface BABCustomLauncher : NSObject <BABLauncher> @end @implementation BABCustomLauncher - (void)openUrl:(NSURL *)url object:(id)object userInfo:(nullable NSDictionary *)userInfo { if ([object isKindOfClass:BABAd.class]) { BABAd *ad = object; NSString *unitId = ad.unitId; NSString *title = ad.creative.title; } ... [UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil]; } @end
ย
// Swift class BABCustomLauncher: NSObject, BABLauncher { func open(_ url: URL, object: Any?, userInfo: [AnyHashable : Any]? = nil) { if let ad = object as? BABAd { let unitId = ad.unitId let title = ad.creative.title } ... UIApplication.shared.open(url, options: nil, completionHandler: nil) } }
BuzzAdBenefit
์Launcher
๋ฅผ ์ธํ ํฉ๋๋ค.// Objective-C BABCustomLauncher *launcher = [[BABCustomLauncher alloc] init]; [BuzzAdBenefit setLauncher:launcher];
ย
// Swift let adLauncher = BABCustomLauncher() BuzzAdBenefit.setLauncher(launcher)
โป ์ฃผ์์ฌํญ
๋ค์ํ ๊ด๊ณ ์ ํน์ฑ์ ๊ด๊ณ ๋ฅผ ํด๋ฆญํ์ ๋ ๋ฅ๋งํฌ๊ฐ ๋์ํ์ฌ ์ธ์ฑ ๋ธ๋ผ์ฐ์ ์์ ๊ด๊ณ ์ฃผ์ ์ฑ์ผ๋ก ์ดํํ๊ฒ ๋๋ ๊ฒฝ์ฐ๊ฐ ์์ ์ ์์ต๋๋ค. ๋ฐ๋ผ์ Launcher ์ฌ์ฉ์ ์ ์ ๊ฐ ๊ด๊ณ ํด๋ฆญ ํ ๊ด๊ณ ์ฃผ ์ฑ ํ๋ฉด์์ ๋ค๋ก๊ฐ๊ธฐ ํน์ Back ๋ฒํผ์ ๋๋ ์ ๋, ์ฒ์ ๊ด๊ณ ๊ฐ ๋ณด์ด๋ ํ๋ฉด์ผ๋ก ์ ๋๋ก ๋์์ฌ ์ ์๋๋ก ์ธ์ฑ ๋ธ๋ผ์ฐ์ ์ ๋์์ด ๊ตฌํ ๋์ด์ผ ํฉ๋๋ค.
์ด๋ ๊ฒ ๊ด๊ณ ์ฃผ ์ฑ์ผ๋ก ์ดํํ๊ฒ ๋๋ ๋ฅ๋งํฌ URL ๊ด๊ณ ์ ๊ฒฝ์ฐ
ad.creative.isDeeplink
์ ๊ฐ์ดYES
๋ก return ๋๊ฒ ๋ฉ๋๋ค.
ย
Custom launcher ์ฌ์ฉ์ ๋ฅ๋งํฌ ๊ด๊ณ ์ฒ๋ฆฌ ๊ฐ์ด๋
์ธ๋ถ ์ฑ์ผ๋ก ๋๋ฉ๋๋ ๋ฅ๋งํฌ ๊ด๊ณ ์ ๊ฒฝ์ฐ redirect ๊ณผ์ ์ ๊ฑฐ์ณ ์ต์ข ์ ์ผ๋ก ํ๊ฒ ์ฑ(๋๋ ์ฑ์คํ ์ด)์ผ๋ก ์ด๋ํ๊ฒ ๋ฉ๋๋ค. ์ด ๊ฒฝ์ฐ ์ฌ์ฉ์๊ฐ ๋ค์ ๋ณธ ์ฑ์ผ๋ก ๋์์์ ๋ redirect๊ฐ ์ผ์ด๋ฌ๋ ์ธ์ฑ ๋ธ๋ผ์ฐ์ ๊ฐ ๋น ํ์ด์ง์ธ ์ํ๋ก ์ด๋ ค์๊ฒ ๋ฉ๋๋ค. ๋ฐ๋ผ์ ์์ฐ์ค๋ฌ์ด UX๋ฅผ ์ํ์ฌ ์ธ๋ถ ์ฑ์ผ๋ก ๋๋ฉ๋๋ ๊ด๊ณ ์ ๊ฒฝ์ฐ ์ธ์ฑ ๋ธ๋ผ์ฐ์ ๋ฅผ ๋ซ์ ์ฌ์ฉ์๊ฐ ๋ณธ ์ฑ์ผ๋ก ๋์์์ ๋ ๋น ํ๋ฉด์ ๋ณด์ง ์๋๋ก ์ฒ๋ฆฌํด์ผ ํฉ๋๋ค. ์ด ๋ ์๋ 2๊ฐ์ง ๋ฐฉ๋ฒ ์ค ํ๋๋ฅผ ์ ํํ์ฌ ๊ตฌํํฉ๋๋ค.
์ธ์ฑ ๋ธ๋ผ์ฐ์ ๋ด์์ ์ผ์ด๋๋ redirect๋ฅผ ๋ชจ๋ํฐํ์ฌ http/https๊ฐ ์๋ scheme์ด ํธ์ถ๋ ๊ฒฝ์ฐ ํ๊ฒ ์ฑ์ด ์ด๋ฆฐ ๋ค ์ธ์ฑ ๋ธ๋ผ์ฐ์ ๋ ์๋์ผ๋ก ๋ซํ๋๋ก ๊ตฌํํฉ๋๋ค.
Ad ์์ Creative ๊ฐ์ฒด๊ฐ ๊ฐ์ง isDeeplink ํ๋(
ad.creative.isDeeplink
)๋ฅผ ์ด์ฉํ์ฌ ์ฌ์ฉ์๊ฐ ์ธ์ฑ ๋ธ๋ผ์ฐ์ ๊ฐ ์ด๋ ค์๋ ์ํ์์ ๋ณธ ์ฑ์ ์ดํํ์ ๋ ์ธ์ฑ ๋ธ๋ผ์ฐ์ ๊ฐ ์๋์ผ๋ก ๋ซํ๋๋ก ๊ตฌํํฉ๋๋ค. ๋ฒ์ฆ๋น์์๋ ๊ฐ ๊ด๊ณ ์ ๋๋ฉ ํ์ ์ ๋ฏธ๋ฆฌ ์ฒดํฌํ์ฌ ๋ฅ๋งํฌ ๊ด๊ณ ์ธ ๊ฒฝ์ฐ isDeeplink๋ฅผ true๋ก, ์ผ๋ฐ ์น ๋๋ฉ ๊ด๊ณ ์ธ ๊ฒฝ์ฐ isDeeplink๋ฅผ false๋ก ๋ด๋ ค์ฃผ๊ณ ์์ต๋๋ค. ๋ฐ๋ผ์ isDeeplink๊ฐ true์ธ ๊ด๊ณ ๊ฐ ์ธ์ฑ ๋ธ๋ผ์ฐ์ ๋ก ์ด๋ ค์๋ ์ํ์์ ๋ณธ ์ฑ์ด ๋ฐฑ๊ทธ๋ผ์ด๋๋ก ๋ด๋ ค๊ฐ ๊ฒฝ์ฐ ํ๊ฒ ์ฑ์ผ๋ก ์ด๋ํ ๊ฒ์ผ๋ก ํ๋จํ์ฌ ์ธ์ฑ ๋ธ๋ผ์ฐ์ ๋ฅผ ๋ซ์์ผ ํฉ๋๋ค.
ย
Custom launcher ์ฌ์ฉ์ Article์ sourceUrl ์ฌ์ฉ๋ฒ
์ปจํ
์ธ ์ ๊ฒฝ์ฐ url scheme์ ๋ฐ๋ผ ๋๋ฉ ๋ฐฉ์์ ๋ค๋ฅด๊ฒ ์ฒ๋ฆฌํ๊ณ ์ถ๋ค๋ฉด(ex. ์ฑ ์์์ ๋ธ๋ผ์ฐ์ ์คํ ์์ด ๋ค๋ฅธ ํ๋ฉด์ผ๋ก ์ด๋๋๋ ์ปจํ
์ธ ) ๋ค์๊ณผ ๊ฐ์ ๋ฐฉ๋ฒ์ผ๋กย NativeArticle
ย ๊ฐ์ฒด์ย sourceUrl
์ ๊ฐ์ ธ์ ๋ถ๊ธฐ ์ฒ๋ฆฌ๋ฅผ ํ ์ ์์ต๋๋ค.
ย
// Objective-C
- (void)openUrl:(NSURL *)url object:(id)object userInfo:(nullable NSDictionary *)userInfo {
if ([object isKindOfClass:BABArticle.class]) {
BABArticle *article = object;
NSString *sourceUrl = article.sourceUrl;
...
}
}
ย
// Swift
func open(_ url: URL, object: Any?, userInfo: [AnyHashable : Any]? = nil) {
if let article = object as? BABArticle {
let sourceUrl = article.sourceUrl
...
}
}
ย
๊ด๊ณ ๋ก๋ ์คํจ์ ์๋ฌ ์ ๋ณด ํ์ธ
๊ด๊ณ ๋ก๋ ์คํจ์ ๋ถ๋ฆฌ๋ ์ฝ๋ฐฑ์ ํ๋ผ๋ฏธํฐ๋ก ๋์ด์ค๋ BABError
๊ฐ์ฒด์ code
ํ๋กํผํฐ๋ฅผ ํตํด ํด๋น ์๋ฌ์ ์ ๋ณด๋ฅผ ํ์ธํ ์ ์์ต๋๋ค.
ย
typedef enum {
BABUnknownError = 0,
BABServerError,
BABInvalidRequest,
BABRequestTimeout,
BABEmptyResponse
} BABErrorCode;
ย
์ก์ ํ ๊ด๊ณ ์ ๋ํ ์ ์ VOC ํ์ด์ง
BuzzAd Benefit SDK๋ ๋น๋์ค, ์ฑ ์ธ์คํจ, ํ์ด์ค๋ถ ํ์ด์ง ์ข์์ ๋ฑ ๋ค์ํ ์ ์ ์ก์ ์ ๋ฆฌ์๋๋ฅผ ์ง๊ธํ๋ ๊ด๊ณ ๋ฅผ ์ ๊ณตํฉ๋๋ค. ๊ทธ๋ฆฌ๊ณ ์ด๋ฐ ๊ด๊ณ ์ ๊ฒฝ์ฐ ์ข ์ข ๋ฆฌ์๋ ๋ฏธ์ ๋ฆฝ์ ์ด์ ๋ก ์ ์ ๊ฐ VOC๋ฅผ ๋ณด๋ด๊ธฐ๋ ํฉ๋๋ค. ์ด๋ฌํ ์ ์ VOC์ ๋ํ ์ ์ ๋ฐ ์ฒ๋ฆฌ๋ฅผ ์๋ํ ํ๊ธฐ ์ํด SDK์์๋ ๋ฏธ๋ฆฌ ๋ง๋ค์ด ๋์ ์น ํ์ด์ง๋ฅผ ์ ๊ณตํ๊ณ ์์ต๋๋ค. ์๋์ ๋จ๊ณ๋ฅผ ํตํด ํด๋น ๊ธฐ๋ฅ์ ์ฌ์ฉํ์ค ์ ์์ต๋๋ค.
ย
์๋ ์์์ ๊ฐ์ด VOC ํ์ด์ง ๋ก๋๋ฅผ ์ํ ์ ์ ์ง์ Icon/Tab์ ๋์์ธ ํฉ๋๋ค.
๋จ,ย Type B - Feed๋ฅผ ์ฌ์ฉํ์๋ฉด์ Toolbar๋ฅผ Customize ํ์ง ์๊ณ Default Toolbar๋ฅผ ์ฌ์ฉํ์๋ ๊ฒฝ์ฐ ์์ ์ค 2๋ฒ๊ณผ ๊ฐ์ ์์ด์ฝ์ดย ์ด๋ฏธ ๋์์ธ์ ํฌํจ๋์ด ์์ต๋๋ค.1๋ฒ์ Icon/Tab์ด ํด๋ฆญ๋ ๋
[BuzzAdBenefit showInquiryPageOnViewController:viewController]
ํธ์ถํฉ๋๋ค.
ย