(EN) iOS Getting Started - adxcorp/ADXLibrary_Integration GitHub Wiki
In order to get started, please send a registration request to [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'
# Banner, Native, Interstitial
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'
# if you want to use Rewarded Video, please add these lines.
pod 'ADXLibrary-UnityAds', '1.9.1'
1) git-lfs install
brew install git-lfs
2) please put this command
sudo git lfs install --system
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>GADApplicationIdentifier</key>
<string>YOUR APP ID</string>
Enable Bitcode = NO
Before you make any ad-related calls in AppDelegate
, you need to go through initialization using one of Ad Unit IDs you have received from us and then call either showADXConsent
or setConsentState
. Please note that you need to initialize and call showADXConsent
only once. You may proceed to call ad-related methods after completion block gets called.
If you are not serving traffic from EU, you can simply call setConsentState
to manually set GDPR consent state to ADXConsentStateNotRequired
. By doing so, you won't need to call showADXConsent
and may proceed to call ad-related methods right away.
For more information, please refer to GDPR Guide.
- (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;
}
When serving Rewarded Video Ads, you must use either MoPub or AdMob mediation but do not use both. If both mediations are used for serving Rewarded Video Ads, delegate method may not get called.
When serving AdMob Rewarded Video Ads, you must register your test device. Testing without registering your test device may lead to your account being banned. Follow the following instructions:
When you run your application and load Rewarded Video using AdMob, you will see the following log:
<Google> To get test ads on this device, call:
request.testDevices = @[ "2077ef9a63d2b398840261c8221a0c9b" ];
Copy the Device ID and register it as test device.
GADRequest *request = [GADRequest request];
request.testDevices = @[ @"e527e0336ebd9354411d932aa50910ca" ];
- To comply with GDPR,
ADXGDPR
class provides the following methods.
// ADXGDPR instance return
+ (ADXGDPR *)sharedInstance;
// initializes ADXLibrary and checks whether the user is within EU and has already given GDPR consent. It then exposes GDPR consent form if necessary and updates consent state.
- (void)showADXConsent:(ADXConsentCompletionBlock)completionBlock;
// you can use the following method to manually set GDPR consent state without exposing GDPR consent form.
- (void)setConsentState:(ADXConsentState)state;
// gets user's GDPR consent state stored in ```ADXGDPR```
- (ADXConsentState)getConsentState;
// gets AD(x) Privacy Policy URL
- (NSURL *)getPrivacyPolicyURL;
-
ADXConsentState
can be one of the following four values:
// user consent is unknown. Neither ```setConsentState``` or ```showADXConsent``` has been called after installation.
ADXConsentStateUnknown
// user is not within EU and GDPR consent is not required. Personalized ads will be served.
ADXConsentStateNotRequired
// user has not consented to use of personal information. Personalized ads will not be served.
ADXConsentStateDenied
// user has consented to use of personal information. Personalized ads will be served.
ADXConsentStateConfirm
- When running application, you need to either call
showADXConsent
once or usesetConsentState
to set consent state. - If you are not getting traffic from EU, you can call
setConsentState
to manually set consent state toADXConsentStateNotRequired
. By doing so, you won't need to callshowADXConsent
and may proceed to call ad-related methods right away. - Ad-related methods can be called only after
showADXConsent
's completion block has been called. - You can use any one of AD Unit IDs you have received from us.
- (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) {
//*** call ad-related methods only after success has been called
}];
}];
return YES;
}
- If you set
ADXGDPR
'sdebugState
toADXDebugLocateInEEA
and callshowADXConsent
, EU-only GDPR Consent Form UI will be displayed
[ADXGDPR.sharedInstance setDebugState:ADXDebugLocateInEEA];
- When using AdMob Rewarded Video Ads, add the extra data to
AdRequest
as follows:
GADRequest *request = [GADRequest request];
//*** GDPR
if ([ADXGDPR.sharedInstance getConsentState] == ADXConsentStateDenied) {
GADExtras *extras = [[GADExtras alloc] init];
extras.additionalParameters = @{@"npa": @"1"};
[request registerAdNetworkExtras:extras];
}
request.testDevices = @[ @"e527e0336ebd9354411d932aa50910ca" ];