守望者--AIR技术交流

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: ANE FlasCC 炼金术
查看: 2242|回复: 0

广告ANE(AdMob,iAd,MillennialMedia,InMobi, Amazon,)

[复制链接]
  • TA的每日心情
    擦汗
    2018-4-10 15:18
  • 签到天数: 447 天

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

    Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18

    威望
    562
    贡献
    29
    金币
    51784
    钢镚
    1422

    开源英雄守望者

    发表于 2015-4-9 11:15:19 | 显示全部楼层 |阅读模式
    应用下载
    应用名称: Advertising-ANE
    支持64位: 支持
    当前版本: 1.1
    运行平台: Android IOS 
    开发语言: ActionScript 3 JAVA Object-C 
    应用类别: ANE-多平台
    应用简介: Google Mobile Ads (AdMob) (ios 6.12.2/newest google play services)
    iAd (IOS only/Compile with IOS SDK 8.1)
    MillennialMedia (ios 5.4.1/android 5.3.0)
    InMobi (ios 4.5.1/android 4.5.1)
    Amazon Mobile Ads (ios 2.1.8/android 5.4.235)
    Static backfill in house ads (via external images)
    Platform supporting via AdMob Mediation Networks
    Advertising Native Extension for Adobe Air


    Advertising Native Extension for Adobe Air

    This Advertising ANE add supprt to using all major mobile system and popular adverting network with Adobe Air. Supports IOS, Android and Kindle.

    Brought to you by the Indiegogo Campaign.

    Thanks to our Backers.

    • Michał Moczyński link
    • Marcus Frasier link
    • dwight.eppinger

    Support

    This is an open source software. We welcome any contribution and you can send us feedback or features requests in the issues section. But we don't guarantee we can answer all your questions.

    Your kind donations will help us pause my daily job and put more serious effort into the development of this software for the future updates. Thanks.

    If you need a dedicated support service for using this software, you can contact us at support[at]digicrafts.com.hk. We also provide software development services and you can contact us with email.


    Version History

    1.1

    64-bit support for IOS (Need AIR SDK 16+) GooglePlay > 6.12.2 Amazon > ios 2.1.8 /android 5.4.235

    1.0 First public release


    Highlighted Features

    The Universal Advertising AIR native extension will include the following highlighted features:

    • Supporting Android/IOS/Kindle
    • Supporting major advertising network
    • Banner and interstitial ads
    • Auto orientation
    • Setting priority of each advertising network
    • Backfill ads with bitmap or external images
    • Simple API and minimal coding needed.

    Supported Advertising Network

    The current supporting network are list below:

    • Google Mobile Ads (AdMob) (ios 6.12.2/newest google play services)
    • iAd (IOS only/Compile with IOS SDK 8.1)
    • MillennialMedia (ios 5.4.1/android 5.3.0)
    • InMobi (ios 4.5.1/android 4.5.1)
    • Amazon Mobile Ads (ios 2.1.8/android 5.4.235)
    • Static backfill in house ads (via external images)
    • Platform supporting via AdMob Mediation Networks

    (In development)* AdColony (ios 2.4.13/android 2.1.3) (In development)* Unity Ads (ios 1.3.10/android 1.3.10)


    Install the library

    Add the AmazonAds-ANE library to your project.

    In Flash Professional CS6:

    • Create a new mobile project
    • Choose File > PublishSettings...
    • Select the wrench icon next to 'Script' for 'ActionScriptSettings'
    • Select the Library Path tab.
    • Click 'Browse for Native Extension(ANE) File' and select the Mopub.ane file.

    In Flash Builder 4.6:

    • Goto Project Properties
    • Select Native Extensions under Actionscript Build Path
    • Choose Add ANE... and navigate to the Mopub.ane file
    • Select Actionscript Build Packaging > Google Android or Apple IOS
    • Select the Native Extensions tab, and click the 'Package' check box next to the extension

    In Flash Professional CS5.5 or Lower:

    • Select File>PublishSettings>Flash>ActionScript 3.0 Settings
    • Select External Library Path
    • Click Browseto SWC File
    • Select the Mopub.swc

    In Flash Builder 4.5:

    • Goto Project Properties
    • Select Action Script Build Path
    • Select Add Swc
    • Navigate to Mopub.swc and choose External Library type

    In FlashDevelop:

    • Copy the Mopub.swc file to your project folder.
    • In the explorer panel, right click the .swc and select Add to Library.
    • Right-click the swc file in the explorer, choose Options, and select External Library

    Add the Actionscript

    Import the library

    1. import digicrafts.extensions.Advertising;
    2. import digicrafts.extensions.core.AdSettings;
    3. import digicrafts.extensions.data.*;
    4. import digicrafts.extensions.adapter.*;
    5. import digicrafts.extensions.events.*;
    复制代码
    Create a settings object. And add the adapter for different network.

    1. // Create a setting instance for the banner         
    2. var settings:AdSettings= new AdSettings();

    3. // Manual create adapter
    4. // AdMob
    5. var adMob:AdMobAdapter=new AdMobAdapter('AD-UNIT-ID');
    6. // Amazon
    7. var amazon:AmazonAdapter=new AmazonAdapter('APP_ID');        
    8. // iAd
    9. var iAd:IAdAdapter=new IAdAdapter();
    10. // Backfill
    11. // * Remember to include banner images when you packaging the app
    12. var backfill:BackFillAdapter=new BackFillAdapter('http://www.google.com');
    13. backfill.interstitial="BANNER.png";
    14. backfill.banner="BANNER.png";
    15. backfill.full_banner="FULL_BANNER.png";
    16. backfill.leaderboard="LEADERBOARD.png";
    17. backfill.medium_rectangle="MEDIUM_RECTANGLE.png";

    18. // Add the adapter to the settings
    19. settings.add(adMob,2);
    20. settings.add(amazon,1);
    21. settings.add(iAd,3);
    22. settings.add(backfill,4);
    复制代码
    If you want to load test ads, you can set the testMode property.

    1. Advertising.testMode=true;
    复制代码
    Create a banner and load. Supply an unique name and size for each banner.

    1. Advertising.getBanner('BANNER_1',AdSize.BANNER,settings);
    复制代码
    You can also show the banner immediately. Supply the position and refresh rate.

    1. Advertising.getBanner('BANNER_1',AdSize.BANNER,settings).show(AdPosition.BOTTOM,30);
    复制代码
    Supported positions.
    • AdPosition.BOTTOM
    • AdPosition.BOTTOM_LEFT
    • AdPosition.BOTTOM_RIGHT
    • AdPosition.TOP
    • AdPosition.TOP_LEFT
    • AdPosition.TOP_RIGHT
    • AdPosition.CENTER
    Remove the banner from screen.
    1. Advertising.getBanner('BANNER_1').remove();
    复制代码
    Create an interstitial and load.
    1. Advertising.getInterstitial('INTERSTITIAL_1',AdSize.BANNER,settings);
    复制代码
    Show the Interstitial Ad. Supply the frequency to appear. Also, you can specify the max count to show.
    1. Advertising.getInterstitial('INTERSTITIAL_1').show(3,2);
    复制代码
    You can listen to the event by adding a listener to the Advertising instance.
    1. function handleAdEvent(e:AdEvent):void{

    2. // e.data contains the raw event data

    3. // e.ad contains the ad instance for the event

    4. }
    5. Advertising.getInstance().addEventListener(AdEvent.AD_LOADED, handleAdEvent );
    复制代码
    Supported events.
    • AdEvent.AD_LOADED
      -Event type for ad loaded.
    • AdEvent.AD_WILL_PRESENT
      -Event type for ad will going to show on screen.
    • AdEvent.AD_DID_PRESENT
      -Event type for ad did show on screen.
    • AdEvent.AD_WILL_DISMISS
      -Event type for ad will remove from screen.
    • AdEvent.AD_DID_DISMISS
      -Event type for ad did remove from screen.
    • AdEvent.AD_FAILED_TO_LOAD
      -Event type for ad did fail to load.
    • AdEvent.WILL_LEAVE_APPLICATION
      -Event type for ad did fail to load.

    Setup for Android
    Important Notice: Since the current AIR SDK (<15.0) use an old version build tools and it is not compatialbe with the recent Google Play Service library. It lead to a class missing exception when using AdMob adapter. To fix, copy the dx.jar from the new Android SDK to the AIR SDK.
    Update Your Application DescriptorYou'll need to be using the AIR 14.0 SDK or higher, include the extension in your Application Descriptor XML, and update the Android Manifest Additions with some settings.Add the following settings in tag.
    1. <!-- Google Play -->
    2. <meta-data android:name="com.google.android.gms.version"
    3.     android:value="@integer/google_play_services_version"/>
    4. <activity android:name="com.google.android.gms.ads.AdActivity"
    5.     android:theme="@android:style/Theme.Translucent"
    6.     android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

    7. <!-- Amazon Mobile Ads -->
    8. <activity android:name="com.amazon.device.ads.AdActivity"
    9.     android:configChanges="keyboardHidden|orientation|screenSize"/>

    10. <!-- Millennial Media -->
    11. <activity android:name="com.millennialmedia.android.MMActivity"
    12.     android:theme="@android:style/Theme.Translucent.NoTitleBar"
    13.     android:configChanges="keyboardHidden|orientation|keyboard|screenSize" ></activity>

    14. <!-- InMobi -->
    15. <activity android:name="com.inmobi.androidsdk.IMBrowserActivity"
    16.     android:configChanges="keyboardHidden|orientation|keyboard|smallestScreenSize|screenSize"
    17.     android:theme="@android:style/Theme.Translucent.NoTitleBar"
    18.     android:hardwareAccelerated="true" />
    复制代码
    Add the following basic permissions.
    1. <uses-permission android:name="android.permission.INTERNET"/>
    2. <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    3. <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    4. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    复制代码
    Add the following permission if you want video interstitial supported (millennialmedia).
    1. <uses-permission android:name="android.permission.RECORD_AUDIO" />
    2. <uses-feature android:name="android.hardware.microphone" android:required="false" />
    复制代码
    Add the following permission if you want the ad target location.
    1. <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    2. <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    复制代码

    Developer
    The software is developed by Digicrafts.http://www.facebook.com/DigicraftsComponentshttp://www.digicrafts.com.hk/components
    License
    This project is licensed under the BSD license link


    相关链接:
    https://github.com/digicrafts/Advertising-ANE
    下载

    百度云下载
    守望者AIR技术交流社区(www.airmyth.com)
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    
    关闭

    站长推荐上一条 /4 下一条

    QQ|手机版|Archiver|网站地图|小黑屋|守望者 ( 京ICP备14061876号

    GMT+8, 2019-11-15 23:00 , Processed in 0.051980 second(s), 50 queries .

    守望者AIR

    守望者AIR技术交流社区

    本站成立于 2014年12月31日

    快速回复 返回顶部 返回列表