MAX ANE Documentation

Integration

Add your AppLovin SDK Key

Go to your Project Settings. Select Info, click on one of the rows of Custom iOS Properties and click the + to add a new row. The key of the new row key should be AppLovinSdkKey
and it should have your SDK key value
e.g:
<key>AppLovinSdkKey</key><string>MziT8gS2aacKcumsF6qUd7ZPa1xoZ07xzqT5Vx84WlP8dX</string>

Initialize the SDK

    MAXAdvert.initSDK();

Interstitial Ads

Loading an interstitial ad

To load an interstitial ad, instantiate an MAXAdvert object with your ad unit and call loadAd. You should implement delegate to be notified of when your ad is ready and other ad events.

    //delegate (optional)
     MAXAdvert.getInstance().setInterstitialDidLoadListener(interstitialDidLoadCallback);
     MAXAdvert.getInstance().setInterstitialFailToLoadListener(interstitialFailToLoadCallback);
     MAXAdvert.getInstance().setInterstitialDisplayListener(interstitialDisPlayCallback);
     MAXAdvert.getInstance().setInterstitialHideListener(interstitialHideCallback);
     MAXAdvert.getInstance().setInterstitialClickListener(interstitialClickCallback);
     MAXAdvert.getInstance().setInterstitialFailToDisplayListener(interstitialFailToPlayCallback);

     MAXAdvert.loadInterstitial(unitId);

     public function interstitialHideCallback():void{
        // continue game
        // reloadInterstitial
      }

Showing an interstitial ad

    if (MAXAdvert.isReadyInterstitial()) {
        MAXAdvert.showInterstitial();
    } 

Rewarded Ads

Loading a rewarded ad

To load a rewarded ad, retrieve a MAXAdvert with your rewarded ad unit and call loadRewardVideo. You should implement delegate be notified of when your ad is ready and other ad events.

    //delegate (optional)
     MAXAdvert.getInstance().setRewardVideoDidLoadListener(videoDidLoadCallback);
     MAXAdvert.getInstance().setRewardVideoFailToLoadListener(videoFailToLoadCallback);
     MAXAdvert.getInstance().setRewardVideoDisplayListener(videoDisPlayCallback);
     MAXAdvert.getInstance().setRewardVideoHideListener(videoHideCallback);
     MAXAdvert.getInstance().setRewardVideoClickListener(videoClickCallback);
     MAXAdvert.getInstance().setRewardVideoFailToDisplayListener(videoFailToPlayCallback);
     MAXAdvert.getInstance().setRewardVideoDidCompleteListener(videoDidCompleteCallback);
     MAXAdvert.getInstance().setRewardVideoDidRewardListener(videoDidRewardCallback);
     MAXAdvert.getInstance().setRewardVideoDidStartListener(videoDidStartCallback);

     MAXAdvert.loadRewardVideo(unitId);
     public function videoHideCallback():void{
        // continue game
        // reloadVideo
      }

Showing a rewarded ad

    if(MAXAdvert.isReadyRewardVideo()){
        MAXAdvert.showRewardVideo();
    }

Banners

Loading and showing banners

    /*
     BannerAlign:
     public static const BannerAlignLeft:int = 1 << 0;              
     public static const BannerAlignHorizontalCenter:int = 1<<1;    
     public static const BannerAlignRight:int = 1<<2;           
     public static const BannerAlignTop:int = 1<<3;                 
     public static const BannerAlignVerticalCenter:int = 1<<4;      
     public static const BannerAlignBottom :int = 1<<5;     
    */  

     //delegate (optional)
     MAXAdvert.getInstance().setBannerDidLoadListener(bannerDidLoadCallback);
     MAXAdvert.getInstance().setBannerFailToLoadListener(bannerFailToLoadCallback);
     MAXAdvert.getInstance().setBannerDisplayListener(bannerDisPlayCallback);
     MAXAdvert.getInstance().setBannerHideListener(bannerHideCallback);
     MAXAdvert.getInstance().setBannerClickListener(bannerClickCallback);
     MAXAdvert.getInstance().setBannerFailToDisplayListener(bannerFailToDisplayCallback);
     MAXAdvert.getInstance().setBannerDidCollapseListener(bannerDidCollapseCallback);
     MAXAdvert.getInstance().setBannerDidExpandAdListener(bannerDidExpandAdCallback);

     MAXAdvert.loadBanner(bannerUnitId,MAXPrivateConst.BannerAlignBottom | MAXPrivateConst.BannerAlignHorizontalCenter);

To hide a banner, call the following:

     MAXAdvert.hideBanner();

To show a banner, call the following:

     MAXAdvert.showBanner();

Privacy

The AppLovin SDK requires that publishers set a flag indicating whether a user located in the European Union, European Economic Area, United Kingdom, and Switzerland (collectively, the "European Countries") has provided opt-in consent for the collection and use of personal data for interest-based advertising. In addition to facilitating GDPR compliance, this framework also enables publishers to comply with certain California privacy requirements and various children data restrictions under GDPR, COPPA and App Store policies (see the "Children Data" sections below, respectively).

General Data Protection Regulation ("GDPR")

We recommend using the AppLovin SDK configuration object to determine if the user should be prompted for a consent dialog in the European Countries once AppLovin SDK is initialized. If the user is located in the European Countries, AppLovin will consider that GDPR applies to that user and the user should be prompted with a consent dialogue.

//before you initSDK, you should implement this delegate
MAXAdvert.getInstance().setInitializeSdkFinishBlockListener(showUserConsentDialog);

If the user has consented, please set the following flag to "true" and start requesting ads. Once the consent value is set, AppLovin will treat it accordingly for the lifetime of that application or until consent has been revoked.

    MAXAdvert.setHasUserConsent(true);

If the user has not consented, please set the following flag to "false" and start requesting ads. Once the consent value is set, AppLovin will treat it accordingly for the lifetime of that application or until consent value has changed.

    MAXAdvert.setHasUserConsent(false);

For users outside the European Countries, this flag is not required to be set in the SDK and if set, will not impact how the ad is served to such non-European Countries users.
To ensure that user consent has been set correctly, the AppLovin SDK device logs the privacy states upon initialization.
The "Has User Consent" value will be either "true" or "false" if it was correctly set. Otherwise, it will have a value of "No value set". Note that Once the consent value is set, AppLovin will treat it accordingly for the lifetime of that application or until consent value has changed.

Children Data

iOS Apps in the "Kids" category or iOS Apps intended for children may not use the AppLovin SDK per App Store Review Guidelines 1.3 and 5.1.4.
To ensure COPPA, GDPR, and Google Play policy compliance, you should indicate when a user is a child. If the user is known to be in an age-restricted category (i.e., under the age of 16) please set the following flag to "true".

    MAXAdvert.setIsAgeRestrictedUser(true);

If the user is known not to be in an age-restricted category (i.e., age 16 or older) please set the following flag to "false".

    MAXAdvert.setIsAgeRestrictedUser(false);
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末雷逆,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子碍论,更是在濱河造成了極大的恐慌敌买,老刑警劉巖镰惦,帶你破解...
    沈念sama閱讀 221,273評論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件九榔,死亡現(xiàn)場離奇詭異板丽,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)刹勃,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,349評論 3 398
  • 文/潘曉璐 我一進(jìn)店門堪侯,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人荔仁,你說我怎么就攤上這事伍宦。” “怎么了乏梁?”我有些...
    開封第一講書人閱讀 167,709評論 0 360
  • 文/不壞的土叔 我叫張陵次洼,是天一觀的道長。 經(jīng)常有香客問我遇骑,道長卖毁,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,520評論 1 296
  • 正文 為了忘掉前任落萎,我火速辦了婚禮亥啦,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘模暗。我一直安慰自己禁悠,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,515評論 6 397
  • 文/花漫 我一把揭開白布兑宇。 她就那樣靜靜地躺著碍侦,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上瓷产,一...
    開封第一講書人閱讀 52,158評論 1 308
  • 那天站玄,我揣著相機(jī)與錄音,去河邊找鬼濒旦。 笑死株旷,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的尔邓。 我是一名探鬼主播晾剖,決...
    沈念sama閱讀 40,755評論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼梯嗽!你這毒婦竟也來了齿尽?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,660評論 0 276
  • 序言:老撾萬榮一對情侶失蹤灯节,失蹤者是張志新(化名)和其女友劉穎循头,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體炎疆,經(jīng)...
    沈念sama閱讀 46,203評論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡卡骂,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,287評論 3 340
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了形入。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片全跨。...
    茶點(diǎn)故事閱讀 40,427評論 1 352
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖唯笙,靈堂內(nèi)的尸體忽然破棺而出螟蒸,到底是詐尸還是另有隱情盒使,我是刑警寧澤崩掘,帶...
    沈念sama閱讀 36,122評論 5 349
  • 正文 年R本政府宣布,位于F島的核電站少办,受9級特大地震影響苞慢,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜英妓,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,801評論 3 333
  • 文/蒙蒙 一挽放、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧蔓纠,春花似錦辑畦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,272評論 0 23
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春暂筝,著一層夾襖步出監(jiān)牢的瞬間箩言,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,393評論 1 272
  • 我被黑心中介騙來泰國打工焕襟, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留陨收,地道東北人。 一個月前我還...
    沈念sama閱讀 48,808評論 3 376
  • 正文 我出身青樓鸵赖,卻偏偏與公主長得像务漩,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子它褪,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,440評論 2 359