{"id":13744190,"url":"https://github.com/myflashlab/Admob-ANE","last_synced_at":"2025-05-09T02:32:58.151Z","repository":{"id":82895630,"uuid":"60459251","full_name":"myflashlab/Admob-ANE","owner":"myflashlab","description":"Admob and DoubleClick SDKs for AdobeAIR","archived":true,"fork":false,"pushed_at":"2020-06-07T18:05:59.000Z","size":19050,"stargazers_count":13,"open_issues_count":0,"forks_count":12,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-15T15:42:21.126Z","etag":null,"topics":["admob-ane","adobe-air","ane","firebase-sdk"],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/myflashlab.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-06-05T12:37:07.000Z","updated_at":"2023-08-22T03:35:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"1e88c6fc-fbbc-4a29-9858-55d5c1385355","html_url":"https://github.com/myflashlab/Admob-ANE","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myflashlab%2FAdmob-ANE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myflashlab%2FAdmob-ANE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myflashlab%2FAdmob-ANE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/myflashlab%2FAdmob-ANE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/myflashlab","download_url":"https://codeload.github.com/myflashlab/Admob-ANE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253177873,"owners_count":21866409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admob-ane","adobe-air","ane","firebase-sdk"],"created_at":"2024-08-03T05:01:04.821Z","updated_at":"2025-05-09T02:32:57.491Z","avatar_url":"https://github.com/myflashlab.png","language":"ActionScript","funding_links":[],"categories":["Native Extension","AIR Native Extensions"],"sub_categories":["API ANE"],"readme":"# Admob ANE for Android+iOS\nAdmob ANE supporting [DoubleClick](https://developers.google.com/ad-manager/mobile-ads-sdk/) and [Admob](https://developers.google.com/admob/) SDKs with 100% identical ActionScript API with a super easy interface so you can focus on your game logic while your app is earning more for you the smart way!\n\n**Main Features:**\n* Supporting Banner, Interstitial and Rewarded Video Ads\n* Having control over all required EventListeners \n* Being able to position the banner Ads by pixels\n* Optimized for [Firebase ANEs](https://github.com/myflashlab/Firebase-ANE/)\n* DoubleClick SDK support\n\n[find the latest **asdoc** for this ANE here.](https://myflashlab.github.io/asdoc/com/myflashlab/air/extensions/admob/package-detail.html)  \n[How to get started? **read here**](https://github.com/myflashlab/Admob-ANE/wiki)\n\n# Test UnitIDs\n\n**For DoubleClick**\n* Android/iOS\n\t* banner: ```/6499/example/banner```\n\t* interstitial: ```/6499/example/interstitial```\n\t* rewarded-video: ```/6499/example/rewarded-video```\n\n**For Admob**\n* iOS:\n\t* appId for initializing the ANE: ```ca-app-pub-3940256099942544~1458002511```\n\t* banner: ```ca-app-pub-3940256099942544/2934735716```\n\t* interstitial: ```ca-app-pub-3940256099942544/4411468910```\n\t* rewarded-video: ```ca-app-pub-3940256099942544/1712485313```\n* Android:\n\t* appId for initializing the ANE: ```ca-app-pub-3940256099942544~3347511713```\n\t* banner: ```ca-app-pub-3940256099942544/6300978111```\n\t* interstitial: ```ca-app-pub-3940256099942544/1033173712```\n\t* rewarded-video: ```ca-app-pub-3940256099942544/5224354917```\n\n# AIR Usage - Banner Ad\n\n```actionscript\nimport com.myflashlab.air.extensions.admob.*;\nimport com.myflashlab.air.extensions.dependency.OverrideAir;\n\n// initialize AdMob and pass in the Adobe AIR Stage and your AdmMob ApplicationCode\nif(OverrideAir.os == OverrideAir.ANDROID) AdMob.init(stage, \"ca-app-pub-3940256099942544~3347511713\");\nelse if(OverrideAir.os == OverrideAir.IOS)AdMob.init(stage, \"ca-app-pub-3940256099942544~1458002511\");\n\n/*\n\tIf you want to initialize DoubleClick SDK instead of admob, all you have to do is to pass null as the\n\tsecond parameter when initializing the ANE:\n\n\tAdMob.init(stage, null);\n*/\n\n// Add general listeners for the Ads\nAdMob.api.addEventListener(AdMobEvents.AD_CLOSED, \t\t\t\tonAdClosed);\nAdMob.api.addEventListener(AdMobEvents.AD_FAILED, \t\t\t\tonAdFailed);\nAdMob.api.addEventListener(AdMobEvents.AD_LEFT_APP, \t\t\tonAdLeftApp);\nAdMob.api.addEventListener(AdMobEvents.AD_LOADED, \t\t\t\tonAdLoaded);\nAdMob.api.addEventListener(AdMobEvents.AD_OPENED, \t\t\t\tonAdOpened);\n\n// listen to the banner Ad to get its final width/height in pixels so you can place it anywhere you like in your Air app\nAdMob.api.banner.addEventListener(AdMobEvents.SIZE_MEASURED, \tonBannerAdSizeReceived);\n\n// to create a banner Ad, first you need to initialize a new banner with your unitId and prefered banner size\nif(OverrideAir.os == OverrideAir.ANDROID) AdMob.api.banner.init(\"ca-app-pub-3940256099942544/6300978111\", ApiBannerAds.BANNER);\nelse if(OverrideAir.os == OverrideAir.IOS)AdMob.api.banner.init(\"ca-app-pub-3940256099942544/2934735716\", ApiBannerAds.BANNER);\n\n// then you should create a new Ad request\nvar adRequest:AdRequest = new AdRequest();\n\n/*\n\tYou may customize your Ad requests in many different ways. Read here to learn more about Ad Requests\n\thttp://myflashlab.github.io/asdoc/com/myflashlab/air/extensions/admob/AdRequest.html\n\t\n\tYet, one of the handy options is the adRequest.testDevices property which allows you to pass an Array of all\n\tyour test devices so you can safely test your Ads before going live. If you don't know how you can receive your\n\tdevice's ID, read here for Android:\n\thttps://firebase.google.com/docs/admob/android/targeting#test_ads\n\tor here for iOS:\n\thttps://firebase.google.com/docs/admob/ios/targeting#test_ads\n\t\n\tFor the best practice usage of banner Ads, read here:\n\thttps://support.google.com/admob/answer/6128877?hl=en\n\n\n\t\u003e\u003e IMPORTANT \u003c\u003c\n\tRequesting Consent from European Users\n\tBased on users consent, you should set if your app should show\n\tpersonalized ads or not. By default, Admob shows personalized Ads.\n\tIn case your user does not allow that, you should also make sure that\n\tshown ads are not personalized. You can do this like below:\n\t\t\t\t\t\n\tadRequest.extras = {npa:1}; // npa stands for \"Non-Personalized Ads\"\n\t\n\tFor more information, read here:\n\thttps://developers.google.com/admob/ios/eu-consent#forward_consent_to_the_google_mobile_ads_sdk\n\thttps://developers.google.com/admob/android/eu-consent#forward_consent_to_the_google_mobile_ads_sdk\n*/\n\n// Now that you have the Ad request ready, simply load your banner! That simple.\nAdMob.api.banner.loadAd(adRequest);\n\n// If you wish to change the position of the loaded banner, which is (0, 0) by default, you should listen for AdMobEvents.AD_LOADED\nprivate function onAdLoaded(e:AdMobEvents):void\n{\n\tif (e.adType == AdMob.AD_TYPE_BANNER)\n\t{\n\t\t// place the Ad at the center of your game, or anywhere else you wish!\n\t\tAdMob.api.banner.x = stage.stageWidth / 2 - AdMob.api.banner.width / 2;\n\t\tAdMob.api.banner.y = stage.stageHeight / 2 - AdMob.api.banner.height / 2;\n\t}\n} \n```\n\n# AIR Usage - Interstitial Ad\n\n```actionscript\nimport com.myflashlab.air.extensions.admob.*;\nimport com.myflashlab.air.extensions.dependency.OverrideAir;\n\n// initialize AdMob and pass in the Adobe AIR Stage and your AdmMob ApplicationCode\nif(OverrideAir.os == OverrideAir.ANDROID) AdMob.init(stage, \"ca-app-pub-3940256099942544~3347511713\");\nelse if(OverrideAir.os == OverrideAir.IOS)AdMob.init(stage, \"ca-app-pub-3940256099942544~1458002511\");\n\n/*\n\tIf you want to initialize DoubleClick SDK instead of admob, all you have to do is to pass null as the\n\tsecond parameter when initializing the ANE:\n\n\tAdMob.init(stage, null);\n*/\n\n// Add general listeners for the Ads\nAdMob.api.addEventListener(AdMobEvents.AD_CLOSED, \t\t\t\tonAdClosed);\nAdMob.api.addEventListener(AdMobEvents.AD_FAILED, \t\t\t\tonAdFailed);\nAdMob.api.addEventListener(AdMobEvents.AD_LEFT_APP, \t\t\tonAdLeftApp);\nAdMob.api.addEventListener(AdMobEvents.AD_LOADED, \t\t\t\tonAdLoaded);\nAdMob.api.addEventListener(AdMobEvents.AD_OPENED, \t\t\t\tonAdOpened);\n\n/*\n\tOne thing you should remember about interstitial Ads, is that you should load them first,\n\twait for them to be loaded, then show them when appropriate. For the best practice usage of\n\tinterstitial Ads, read here: https://support.google.com/admob/answer/6066980?hl=en\n*/\n\n// The first step is to initialize a new interstitial Ad with your unitId that you have created in your Admob console.\nif(OverrideAir.os == OverrideAir.ANDROID) AdMob.api.interstitial.init(\"ca-app-pub-3940256099942544/1033173712\");\nelse if(OverrideAir.os == OverrideAir.IOS)AdMob.api.interstitial.init(\"ca-app-pub-3940256099942544/4411468910\");\n\n// then create a new Ad request just like how you did for the Banner Ads\nvar adRequest:AdRequest = new AdRequest();\n\n// And then load it!\nAdMob.api.interstitial.loadAd(adRequest);\n\n// now, you must wait for the banner to load before you can show it.\nprivate function onAdLoaded(e:AdMobEvents):void\n{\n\tif (e.adType == AdMob.AD_TYPE_INTERSTITIAL)\n\t{\n\t\t// Your Ad is ready to be shown. show it whenever you like; But not when your app is in background!\n\t\tif(_isAppInBackground)\n\t\t{\n\t\t\ttrace(\"should not play the video when app is in background\")\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(AdMob.api.interstitial.isLoaded)\n\t\t\t{\n\t\t\t\tAdMob.api.interstitial.show();\n\t\t\t}\n\t\t}\n\t}\n}\n```\n\n# AIR Usage - RewardedVideo Ad\n\n```actionscript\nimport com.myflashlab.air.extensions.admob.*;\nimport com.myflashlab.air.extensions.dependency.OverrideAir;\n\n// initialize AdMob and pass in the Adobe AIR Stage and your AdmMob ApplicationCode\nif(OverrideAir.os == OverrideAir.ANDROID) AdMob.init(stage, \"ca-app-pub-3940256099942544~3347511713\");\nelse if(OverrideAir.os == OverrideAir.IOS)AdMob.init(stage, \"ca-app-pub-3940256099942544~1458002511\");\n\n/*\n\tIf you want to initialize DoubleClick SDK instead of admob, all you have to do is to pass null as the\n\tsecond parameter when initializing the ANE:\n\n\tAdMob.init(stage, null);\n*/\n\n// Add general listeners for the Ads\nAdMob.api.addEventListener(AdMobEvents.AD_CLOSED, \t\t\t\tonAdClosed);\nAdMob.api.addEventListener(AdMobEvents.AD_FAILED, \t\t\t\tonAdFailed);\nAdMob.api.addEventListener(AdMobEvents.AD_LEFT_APP, \t\t\tonAdLeftApp);\nAdMob.api.addEventListener(AdMobEvents.AD_LOADED, \t\t\t\tonAdLoaded);\nAdMob.api.addEventListener(AdMobEvents.AD_OPENED, \t\t\t\tonAdOpened);\n\n// listen to the RewardVideo Ad events\nAdMob.api.rewardedVideo.addEventListener(AdMobEvents.AD_BEGIN_PLAYING, onAdBeginPlayiing);\nAdMob.api.rewardedVideo.addEventListener(AdMobEvents.AD_END_PLAYING, onAdEndPlayiing);\nAdMob.api.rewardedVideo.addEventListener(AdMobEvents.AD_DELIVER_REWARD, onDeliverReward);\n\n// then create a new Ad request just like how you did for the Banner Ads\nvar adRequest:AdRequest = new AdRequest();\n\nif(OverrideAir.os == OverrideAir.ANDROID) AdMob.api.rewardedVideo.loadAd(adRequest, \"ca-app-pub-3940256099942544/5224354917\");\nelse if(OverrideAir.os == OverrideAir.IOS)AdMob.api.rewardedVideo.loadAd(adRequest, \"ca-app-pub-3940256099942544/1712485313\");\n\n// now, you must wait for the banner to load before you can show it.\nprivate function onAdLoaded(e:AdMobEvents):void\n{\n\tif (e.adType == AdMob.AD_TYPE_REWARDED_VIDEO)\n\t{\n\t\t// Your Ad is ready to be shown. show it whenever you like; But not when your app is in background!\n\t\tif(_isAppInBackground)\n\t\t{\n\t\t\ttrace(\"should not play the video when app is in background\")\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(AdMob.api.rewardedVideo.isReady)\n\t\t\t{\n\t\t\t\tAdMob.api.rewardedVideo.show();\n\t\t\t}\n\t\t}\n\t}\n}\n\nprivate function onDeliverReward(e:AdMobEvents):void\n{\n\ttrace(\"onDeliverReward Type: \" + e.rewardType + \" amount: \" + e.rewardAmount);\n}\n```\n\n# AIR .xml manifest\n\n```xml\n\u003c!--\nFOR ANDROID:\n--\u003e\n\u003cmanifest android:installLocation=\"auto\"\u003e\n\t\n\t\u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n\t\u003cuses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/\u003e\n\t\u003cuses-sdk android:targetSdkVersion=\"28\"/\u003e\n\t\n\t\u003capplication\u003e\n\t\t\n\t\t\u003cactivity\u003e\n\t\t\t\u003cintent-filter\u003e\n\t\t\t\t\u003caction android:name=\"android.intent.action.MAIN\" /\u003e\n\t\t\t\t\u003ccategory android:name=\"android.intent.category.LAUNCHER\" /\u003e\n\t\t\t\u003c/intent-filter\u003e\n\t\t\t\u003cintent-filter\u003e\n\t\t\t\t\u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n\t\t\t\t\u003ccategory android:name=\"android.intent.category.BROWSABLE\" /\u003e\n\t\t\t\t\u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n\t\t\t\u003c/intent-filter\u003e\n\t\t\u003c/activity\u003e\n\t\t\n\t\t\u003c!-- Include the AdActivity configChanges and themes. --\u003e\n\t\t\u003cactivity\n\t\t\tandroid:name=\"com.google.android.gms.ads.AdActivity\"\n\t\t\tandroid:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize\"\n\t\t\tandroid:theme=\"@android:style/Theme.Translucent\" /\u003e\n\t\t\t\n\t\t\u003cmeta-data\n\t\t\tandroid:name=\"com.google.android.gms.version\"\n\t\t\tandroid:value=\"@integer/google_play_services_version\" /\u003e\n\n\n\t\t\u003c!-- If you are using Admob (must remove the Double-Click meta-data tag) --\u003e\n\t\t\u003cmeta-data\n\t\t\tandroid:name=\"com.google.android.gms.ads.APPLICATION_ID\"\n\t\t\tandroid:value=\"ca-app-pub-3940256099942544~3347511713\"/\u003e \u003c!-- Replace with your own APPLICATION_ID --\u003e\n\n\t\t\u003c!-- If you are using Double-Click (must remove the Admob meta-data tag) --\u003e\n\t\t\u003cmeta-data\n\t\tandroid:name=\"com.google.android.gms.ads.AD_MANAGER_APP\"\n\t\tandroid:value=\"true\"/\u003e\n\t\t\n\t\u003c/application\u003e\n\u003c/manifest\u003e\n\n\n\n\n\n\u003c!--\nFOR iOS:\n--\u003e\n\t\u003cInfoAdditions\u003e\n\t\t\u003c!--iOS 10.0 or higher can support this ANE--\u003e\n\t\t\u003ckey\u003eMinimumOSVersion\u003c/key\u003e\n\t\t\u003cstring\u003e10.0\u003c/string\u003e\n\t\t\n\t\t\u003ckey\u003eNSAppTransportSecurity\u003c/key\u003e\n\t\t\u003cdict\u003e\n\t\t\t\u003ckey\u003eNSAllowsArbitraryLoads\u003c/key\u003e\n\t\t\t\u003ctrue/\u003e\n\t\t\u003c/dict\u003e\n\n\n\t\t\u003c!-- If you are using Admob (must remove GADIsAdManagerApp) --\u003e\n\t\t\u003ckey\u003eGADApplicationIdentifier\u003c/key\u003e\n\t\t\u003cstring\u003eca-app-pub-3940256099942544~1458002511\u003c/string\u003e \u003c!-- Replace with your own APPLICATION_ID --\u003e\n\n\t\t\u003c!-- If you are using Double-Click (must remove GADApplicationIdentifier) --\u003e\n\t\t\u003ckey\u003eGADIsAdManagerApp\u003c/key\u003e\n\t\t\u003ctrue/\u003e\n\n\t\t\n\t\u003c/InfoAdditions\u003e\n\n\n\n\t\n\u003c!--\nEmbedding the ANE:\n--\u003e\n  \u003cextensions\u003e\n\t\n\t\u003c!-- dependency ANEs https://github.com/myflashlab/common-dependencies-ANE --\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.dependency.overrideAir\u003c/extensionID\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.dependency.androidx.arch\u003c/extensionID\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.dependency.androidx.core\u003c/extensionID\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.dependency.androidx.browser\u003c/extensionID\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.dependency.androidx.lifecycle\u003c/extensionID\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.dependency.googlePlayServices.ads\u003c/extensionID\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.dependency.googlePlayServices.ads.lite\u003c/extensionID\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.dependency.googlePlayServices.basement\u003c/extensionID\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.dependency.googlePlayServices.measurementBase\u003c/extensionID\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.dependency.googlePlayServices.gass\u003c/extensionID\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.dependency.gson\u003c/extensionID\u003e\n\t\n\t\u003c!-- And finally embed the main Admob ANE --\u003e\n\t\u003cextensionID\u003ecom.myflashlab.air.extensions.admob\u003c/extensionID\u003e\n\t\n  \u003c/extensions\u003e\n--\u003e\n```\n\n# Requirements \n1. Android API 19+\n2. iOS SDK 10.0+\n3. AIR SDK 30+\n4. To compile on iOS, you will need to add the followng frameworks to your AIR SDK at location: ```AIR_SDK/lib/aot/stub```. Download them from [Firebase SDK V6.18.0](https://dl.google.com/firebase/sdk/ios/6_18_0/Firebase-6.18.0.zip).\n* GoogleMobileAds.framework\n* FIRAnalyticsConnector.framework\n* FirebaseAnalytics.framework\n* FirebaseCore.framework\n* FirebaseCoreDiagnostics.framework\n* FirebaseInstallations.framework\n* FirebaseInstanceID.framework\n* GoogleAppMeasurement.framework\n* GoogleDataTransport.framework\n* GoogleDataTransportCCTSupport.framework\n* GoogleUtilities.framework\n* nanopb.framework\n* PromisesObjC.framework\n\n# Commercial Version\nhttps://www.myflashlabs.com/product/firebase-admob-air-native-extension/\n\n[![Admob ANE](https://www.myflashlabs.com/wp-content/uploads/2016/06/product_adobe-air-ane-extension-admob-2018-595x738.jpg)](https://www.myflashlabs.com/product/firebase-admob-air-native-extension/)\n\n# Tutorials\n[How to embed ANEs into **FlashBuilder**, **FlashCC** and **FlashDevelop**](https://www.youtube.com/watch?v=Oubsb_3F3ec\u0026list=PL_mmSjScdnxnSDTMYb1iDX4LemhIJrt1O)  \n[How to get started with Admob?](https://github.com/myflashlab/Admob-ANE/wiki)\n\n# Premium Support #\n[![Premium Support package](https://www.myflashlabs.com/wp-content/uploads/2016/06/professional-support.jpg)](https://www.myflashlabs.com/product/myflashlabs-support/)\nIf you are an [active MyFlashLabs club member](https://www.myflashlabs.com/product/myflashlabs-club-membership/), you will have access to our private and secure support ticket system for all our ANEs. Even if you are not a member, you can still receive premium help if you purchase the [premium support package](https://www.myflashlabs.com/product/myflashlabs-support/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyflashlab%2FAdmob-ANE","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmyflashlab%2FAdmob-ANE","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmyflashlab%2FAdmob-ANE/lists"}