Example App
Adrop
์ Importํ์ธ์.
App delegate์ application(_:didFinishLaunchingWithOptions:)
๋ฉ์๋์์ Adrop ๊ณต์ ๋ ์ธ์คํด์ค๋ฅผ ์ด๊ธฐํํฉ๋๋ค.
import UIKit
import AdropAds
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions:
[UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// production ๋ฐฐํฌ ์, 'true'๋ฅผ ์ฌ์ฉํ์ธ์.
// ํน์ ๊ตญ๊ฐ์์ ์ด SDK๋ฅผ ์ฌ์ฉํ๊ณ ์๋ค๋ฉด,
// ISO 3166 alpha-2 ๊ตญ๊ฐ ์ฝ๋ array๋ฅผ ์ ๋ฌํ์ธ์.
Adrop.initialize(production: false, targetCountries: [])
return true
}
}
import SwiftUI
import AdropAds
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// production ๋ฐฐํฌ ์, 'true'๋ฅผ ์ฌ์ฉํ์ธ์.
// ํน์ ๊ตญ๊ฐ์์ ์ด SDK๋ฅผ ์ฌ์ฉํ๊ณ ์๋ค๋ฉด,
// ISO 3166 alpha-2 ๊ตญ๊ฐ ์ฝ๋ array๋ฅผ ์ ๋ฌํ์ธ์.
Adrop.initialize(production: false, targetCountries: [])
return true
}
}
@main
struct YourApp: App {
ย // register app delegate for Adrop setup
ย @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
ย var body: some Scene {
ย ย WindowGroup {
ย ย ย NavigationView {
ย ย ย ย ContentView()
ย ย ย }
ย ย }
ย }
}
// AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// production ๋ฐฐํฌ ์, 'YES'๋ฅผ ์ฌ์ฉํ์ธ์.
// ํน์ ๊ตญ๊ฐ์์ ์ด SDK๋ฅผ ์ฌ์ฉํ๊ณ ์๋ค๋ฉด,
// ISO 3166 alpha-2 ๊ตญ๊ฐ ์ฝ๋ array๋ฅผ ์ ๋ฌํ์ธ์.
[Adrop initializeWithProduction:NO targetCountries:@[]];
return YES;
}
production ํ๋ผ๋ฏธํฐ๋ฅผ false๋ก ์ ๋ฌํ ๊ฒฝ์ฐ, SDK๋ด์์ ๋ฐ์ํ๋ ๋ก๊ทธ๊ฐ ์ถ๋ ฅ๋ฉ๋๋ค.
๊ด๊ณ ์ ๋ ๋
ธ์ถํ๊ธฐ
Last updated