iOS Getting Started - adxcorp/ADXLibrary_Integration GitHub Wiki
๊ฐ์ ์ ์ํ์๋ฉด [email protected]๋ก ์ฐ๋ฝ ๋ถํ ๋๋ฆฝ๋๋ค.
Version : 1.9.1
Release Date : 2021/06/22
source 'https://github.com/adxcorp/AdxLibrary_iOS_Release.git'
source 'https://github.com/CocoaPods/Specs.git'
# ๋ฐฐ๋, ๋ค์ดํฐ๋ธ, ์ ๋ฉด
pod 'ADXLibrary', '1.9.1'
pod 'ADXLibrary-FBAudienceNetwork', '1.9.1'
pod 'ADXLibrary-Cauly', '1.9.1'
pod 'ADXLibrary-Pangle', '1.9.1'
pod 'ADXLibrary-Vungle', '1.9.1'
# ๋ฆฌ์๋ ๋น๋์ค ์ฌ์ฉ ์ ์ถ๊ฐ
pod 'ADXLibrary-UnityAds', '1.9.1'
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>GADApplicationIdentifier</key>
<string>YOUR APP ID</string>
Enable Bitcode = NO
- 2021๋
4์ 27์ผ ์๋ฒฝ, ๊ฐ์ธ๋ณดํธ ๊ธฐ๋ฅ์ ๊ฐํํ๋ iOS14.5๊ฐ ๋ฐฐํฌ๋์์ต๋๋ค. ๋ฐ๋์ ์๋ ๊ฐ์ด๋๋ฅผ ํตํด ์ฐ๋ ์งํ ๋ถํ๋๋ฆฝ๋๋ค.
AppDelegate์์ ๊ด๊ณ ๊ด๋ จ ์ฝ๋๋ฅผ ํธ์ถํ๊ธฐ ์ , ๋ฐ๊ธ๋ฐ์ผ์ Ad Unit ID ์ค ํ๋๋ง ์ฌ์ฉํ์ฌ initialize ํด์ฃผ์๊ณ , showADXConsent ๋๋ setConsentState๋ฅผ ํธ์ถํด์ฃผ์๋ฉด ๋ฉ๋๋ค. completion block์ด ํธ์ถ๋ ํ ๊ด๊ณ ๊ด๋ จ ์ฝ๋๋ฅผ ์ฌ์ฉํด์ฃผ์๊ณ , initialize ๋ฐ showADXConsent๋ ํ ๋ฒ๋ง ํธ์ถํด์ฃผ์๋ฉด ๋ฉ๋๋ค.
EU ํธ๋ํฝ์ด ์์ผ์ ๊ฒฝ์ฐ์๋ setConsentState๋ฅผ ์ด์ฉํ์ฌ ADXConsentStateNotRequired๋ก ๋์ ์ฌ๋ถ๋ฅผ ์ ๋ฐ์ดํธ ํด์ฃผ์๊ณ showADXConsent ํธ์ถ ์์ด ๋ฐ๋ก ์ฌ์ฉํ์๋ฉด ๋ฉ๋๋ค.
์์ธํ ๋ด์ฉ์ ํ๋จ์ GDPR ๊ฐ์ด๋๋ฅผ ์ฐธ๊ณ ํ์ฌ ์ฃผ์๋ฉด ๋ฉ๋๋ค.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
MPMoPubConfiguration *sdkConfig = [[MPMoPubConfiguration alloc] initWithAdUnitIdForAppInitialization:<YOUR AD UNIT ID>];
[[MoPub sharedInstance] initializeSdkWithConfiguration:sdkConfig
completion:^{
[ADXGDPR.sharedInstance showADXConsent:^(ADXConsentState consentState, BOOL success) {
}];
}];
return YES;
}
MoPub/AdMob ์ฐ๋ ์ฝ๋๋ฅผ ํจ๊ป ์ฌ์ฉํ์๋ฉด ์ ์์ ์ผ๋ก delegate method ํธ์ถ์ด ๋์ง ์์ ์ ์์ผ๋ฏ๋ก, ๋ฐ๋์ ํ๋์ ์ฐ๋ ์ฝ๋๋ง ์ฌ์ฉํด์ฃผ์ ์ผ ํฉ๋๋ค.
AdMob Rewarded Video๋ฅผ ์ด์ฉํ์ค ๊ฒฝ์ฐ ๊ฐ๋ฐ์ค ๋ฐ๋์ ์๋ ๋ด์ฉ์ ์ฐธ๊ณ ํ์ฌ ํ ์คํธ ๋๋ฐ์ด์ค๋ฅผ ๋ฑ๋ก ํ ์ฌ์ฉํด์ฃผ์๊ธฐ ๋ฐ๋๋๋ค. ํ ์คํธ ๋๋ฐ์ด์ค ๋ฏธ๋ฑ๋ก ์ํ๋ก ํ ์คํธํ ๊ฒฝ์ฐ ๊ณ์ ์ด ์ ์ง๋ ์ ์์ต๋๋ค.
AdMob์ ์ด์ฉํ์ฌ Rewarded Video๋ฅผ ๋ก๋ํ๋ ์ฝ๋๊ฐ ์ฝ์ ๋ ์ํ๋ก run ํด์ฃผ์๋ฉด ์๋์ ๊ฐ์ ๋ก๊ทธ๋ฅผ ํ์ธํ์ค ์ ์์ต๋๋ค.
<Google> To get test ads on this device, set:
GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ @"aa20271272d6558e1bff61b329dd436c" ];
์ด device ID๋ฅผ ๋ณต์ฌํ์ฌ ํ ์คํธ ๋๋ฐ์ด์ค๋ก ๋ฑ๋กํด์ฃผ์๋ฉด ๋ฉ๋๋ค.
GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ @"aa20271272d6558e1bff61b329dd436c" ];
- GDPR ๊ท์ ์ ์ค์ํ๊ธฐ ์ํด ADXGDPR class ์์ ์ ๊ณตํ๊ณ ์๋ ์๋์ ๊ฐ์ function์ ์ฌ์ฉํ์ค์ ์์ต๋๋ค.
// ADXGDPR instance return
+ (ADXGDPR *)sharedInstance;
// GDPR ๊ท์ ์ ์ค์ํ๊ธฐ ์ํ์ฌ ๊ธฐ์กด ๋์ ์ฌ๋ถ, EU ์ฌ์ฉ์ ์ฌ๋ถ๋ฅผ ํ์ธํ์ฌ ๊ฐ์ธ์ ๋ณด ์์ง ๋ฐ ์ด์ฉ์ ๋ํ ๋์ ํ๋ฉด์ ๋
ธ์ถํ์ฌ ๋์ ์ ๋ณด๋ฅผ ์ ์ฅํฉ๋๋ค.
- (void)showADXConsent:(ADXConsentCompletionBlock)completionBlock;
// ADX์์ ์ ๊ณตํ๋ ๋์ ํ๋ฉด์ ์ฌ์ฉํ์ง ์์ผ์ค ๊ฒฝ์ฐ, ์๋ function์ ์ด์ฉํ์ฌ ์ง์ ๋์ ์ฌ๋ถ๋ฅผ ์ค์ ํ์ค์ ์์ต๋๋ค.
- (void)setConsentState:(ADXConsentState)state;
// ADXGDPR์ ์ค์ ๋ ์ฌ์ฉ์์ ๋์ ์ ๋ณด๋ฅผ ํ์ธํ์ค ์ ์์ต๋๋ค.
- (ADXConsentState)getConsentState;
// ADX์ Privacy Policy URL์ ์์ฒญํ ์ ์์ต๋๋ค.
- (NSURL *)getPrivacyPolicyURL;
- ADXConsentState๋ ์๋์ ๊ฐ์ 4๊ฐ์ง ์ํ๊ฐ ์กด์ฌํฉ๋๋ค.
// ์์ง ๋์ ์ ๋ณด๊ฐ ์กด์ฌํ์ง ์๋ ์ฌ์ฉ์๋ก ์ค์น ํ setConsentState๋ showADXConsent๊ฐ ํธ์ถ๋์ง ์์ ์ํ์
๋๋ค. ๊ฐ์ธํ ๊ด๊ณ ๊ฐ ๋
ธ์ถ๋์ง ์์ต๋๋ค.
ADXConsentStateUnknown
// EU๋ด์ ์ฌ์ฉ์๊ฐ ์๋๋ฏ๋ก ๋์์ฌ๋ถ๊ฐ ๋ถํ์ํ ์ฌ์ฉ์์
๋๋ค. ๊ฐ์ธํ ๊ด๊ณ ๊ฐ ๋
ธ์ถ๋ฉ๋๋ค.
ADXConsentStateNotRequired
// ๊ฐ์ธ์ ๋ณด ํ์ฉ ๋์ ํ๋ฉด์์ ๊ฑฐ์ ์ ์ ํํ ์ฌ์ฉ์์
๋๋ค. ๊ฐ์ธํ ๊ด๊ณ ๊ฐ ๋
ธ์ถ๋์ง ์์ต๋๋ค.
ADXConsentStateDenied
// ๊ฐ์ธ์ ๋ณด ํ์ฉ ๋์ ํ๋ฉด์์ ์น์ธ์ ์ ํํ ์ฌ์ฉ์์
๋๋ค. ๊ฐ์ธํ ๊ด๊ณ ๊ฐ ๋
ธ์ถ๋ฉ๋๋ค.
ADXConsentStateConfirm
- Application ์คํ์ AppDelegate์์ 1ํ showADXConsent๋ฅผ ํธ์ถํ์ฌ ์ฃผ์๊ฑฐ๋, setConsentState๋ฅผ ์ด์ฉํ์ฌ ๋์ ์ ๋ณด๋ฅผ ์ ๋ฌํ์ฌ ์ฃผ์๋ฉด ๋ฉ๋๋ค.
- EU ํธ๋ํฝ์ด ์์ผ์ ๊ฒฝ์ฐ์๋ setConsentState๋ฅผ ์ด์ฉํ์ฌ ADXConsentStateNotRequired๋ก ๋์ ์ฌ๋ถ๋ฅผ ์ ๋ฐ์ดํธ ํด์ฃผ์๊ณ showADXConsent ํธ์ถ ์์ด ๋ฐ๋ก ์ฌ์ฉํ์ ๋ ๋ฉ๋๋ค.
- ๊ด๊ณ ๊ด๋ จ ์ฝ๋๋ showADXConsent์ completion block์ด ํธ์ถ๋ ํ ์ฌ์ฉํ์ฌ ์ฃผ์ธ์.
- AD Unit ID๋ ๋ฐ๊ธ๋ฐ์ผ์ ๊ฒ๋ค ์ค ์์์ ๊ฒ์ ํ๋ ์ฌ์ฉํด์ฃผ์๋ฉด ๋ฉ๋๋ค.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
MPMoPubConfiguration *sdkConfig = [[MPMoPubConfiguration alloc] initWithAdUnitIdForAppInitialization:<YOUR AD UNIT ID>];
[[MoPub sharedInstance] initializeSdkWithConfiguration:sdkConfig
completion:^{
[ADXGDPR.sharedInstance showADXConsent:^(ADXConsentState consentState, BOOL success) {
//*** success๊ฐ ํธ์ถ ๋ ํ ๊ด๊ณ ๊ด๋ จ ์ฝ๋๋ฅผ ์ฌ์ฉํด์ฃผ์๊ธฐ ๋ฐ๋๋๋ค.
}];
}];
return YES;
}
- ADXGDPR์ debugState๋ฅผ ADXDebugLocateInEEA๋ก ์ค์ ํ๊ณ showADXConsent๋ฅผ ํธ์ถํด์ฃผ์๋ฉด EU ๋ด์์ ๋ ธ์ถ๋๋ Consent UI๋ฅผ ํ์ธํ์ค์ ์์ต๋๋ค.
[ADXGDPR.sharedInstance setDebugState:ADXDebugLocateInEEA];
- AdMob Rewarded Video๋ฅผ ์ฌ์ฉํ์ค ๊ฒฝ์ฐ AdRequest์ ๋ค์๊ณผ ๊ฐ์ด extra data๋ฅผ ์ถ๊ฐํด์ฃผ์๋ฉด ๋ฉ๋๋ค.
GADRequest *request = [GADRequest request];
//*** GDPR
if ([ADXGDPR.sharedInstance getConsentState] == ADXConsentStateDenied) {
GADExtras *extras = [[GADExtras alloc] init];
extras.additionalParameters = @{@"npa": @"1"};
[request registerAdNetworkExtras:extras];
}