{"id":13744197,"url":"https://github.com/ChartBoost/air","last_synced_at":"2025-05-09T02:33:07.132Z","repository":{"id":12407397,"uuid":"15061010","full_name":"ChartBoost/air","owner":"ChartBoost","description":"Source for the Adobe AIR native extension for the Chartboost SDK with compile scripts.","archived":false,"fork":false,"pushed_at":"2015-07-29T20:17:44.000Z","size":96259,"stargazers_count":42,"open_issues_count":2,"forks_count":19,"subscribers_count":202,"default_branch":"master","last_synced_at":"2025-03-23T13:02:13.480Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ActionScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChartBoost.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-09T22:35:23.000Z","updated_at":"2024-10-28T20:25:02.000Z","dependencies_parsed_at":"2022-09-24T22:50:25.235Z","dependency_job_id":null,"html_url":"https://github.com/ChartBoost/air","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/ChartBoost%2Fair","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fair/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fair/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChartBoost%2Fair/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChartBoost","download_url":"https://codeload.github.com/ChartBoost/air/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253177881,"owners_count":21866413,"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":[],"created_at":"2024-08-03T05:01:04.955Z","updated_at":"2025-05-09T02:33:02.119Z","avatar_url":"https://github.com/ChartBoost.png","language":"ActionScript","readme":"\u003cp\u003eThe Chartboost Adobe AIR plugin provides the functionality for showing ads and MoreApps pages, and supplies our analytics system with detailed information about campaign performance.\u003c/p\u003e\n\u003chr /\u003e\n\u003ch3\u003eContents\u003c/h3\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"#overview\"\u003eOverview\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#preint\"\u003ePre-Integration Steps\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#int\"\u003eInteracting With Chartboost\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#test\"\u003eTesting Your Integration\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#support\"\u003eChartboost Support\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003chr /\u003e\n\u003ch3 id=\"overview\"\u003eOverview\u003c/h3\u003e\n\u003cp\u003eAdding the AIR plugin to your games is quick and easy \u0026ndash; you just need a few ingredients:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eA Chartboost account\u003c/li\u003e\n\u003cli\u003eAn app in your dashboard\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://answers.chartboost.com/hc/en-us/articles/203473969\" target=\"_blank\"\u003eThe latest AIR plugin\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://answers.chartboost.com/hc/en-us/articles/201219605\" target=\"_blank\"\u003eAn active publishing campaign\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u003cstrong\u003eNotes\u003c/strong\u003e\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eThe Chartboost Adobe AIR plugin is currently in beta\u003c/li\u003e\n\u003cli\u003eThe plugin uses \u003ca href=\"https://answers.chartboost.com/hc/en-us/articles/201219435\" target=\"_blank\"\u003eiOS SDK v5.1.5\u003c/a\u003e and \u003ca href=\"https://answers.chartboost.com/hc/en-us/articles/201219445\" target=\"_blank\"\u003eAndroid SDK v5.1.3\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003eThe Chartboost AIR plugin supports \u003cstrong\u003eiOS 6 and higher\u003c/strong\u003e \u0026ndash; Chartboost methods will fail silently on iOS 5 or older operating systems\u003c/li\u003e\n\u003cli\u003eChartboost supports Android 2.3 and higher\u003c/li\u003e\n\u003c/ul\u003e\n\u003chr /\u003e\n\u003ch3 id=\"preint\"\u003ePre-Integration Steps\u003c/h3\u003e\n\u003cp\u003eAfter you've added your app to the Chartboost dashboard and set up a publishing campaign, you're ready to prepare your AIR project for integration with Chartboost.\u003c/p\u003e\n\u003cp\u003eFirst, import the Chartboost native extension in your AIR app. We recommend creating a directory in your project for native extensions where you can copy \u003cstrong\u003eChartboost.ane\u003c/strong\u003e and \u003cstrong\u003eChartboost.swc\u003c/strong\u003e. Then (if you're using Flash Builder) you can simply add that directory as a native extension directory in your project settings.\u003c/p\u003e\n\u003cp\u003eSecond, add the \u003ccode\u003e\u0026lt;extensionID\u0026gt;\u003c/code\u003e declaration to your AIR application descriptor's root \u003ccode\u003e\u0026lt;application\u0026gt;\u003c/code\u003e element:\u003c/p\u003e\n\u003cpre class=\"prettyprint\"\u003e\u0026lt;extensions\u0026gt;\n    \u0026lt;extensionID\u0026gt;com.chartboost.plugin.air\u0026lt;/extensionID\u0026gt;\n\u0026lt;/extensions\u0026gt;\n\u003c/pre\u003e\n\u003cp\u003eIf you'll be building for Android, you must also add these manifest additions to your AIR application descriptor file (remember to swap in your Chartboost app ID and app signature):\u003c/p\u003e\n\u003cpre class=\"prettyprint\"\u003e\u0026lt;manifestAdditions\u0026gt;\u0026lt;![CDATA[\n    \u0026lt;manifest android:installLocation=\"auto\"\u0026gt;\n        \u0026lt;!-- This permission is required for Chartboost. --\u0026gt;\n        \u0026lt;uses-permission android:name=\"android.permission.INTERNET\"/\u0026gt;\n        \n        \u0026lt;!-- These permissions are recommended for Chartboost. --\u0026gt;\n        \u0026lt;uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/\u0026gt;\n        \u0026lt;uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/\u0026gt;\n        \u0026lt;uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/\u0026gt;\n        \n        \u0026lt;application\u0026gt;\n            \u0026lt;!-- The app ID and signature for the Android version of your AIR app must be placed here. --\u0026gt;\n            \u0026lt;meta-data android:name=\"__ChartboostAir__AppID\" android:value=\"ANDROID_APP_ID\" /\u0026gt;\n            \u0026lt;meta-data android:name=\"__ChartboostAir__AppSignature\" android:value=\"ANDROID_APP_SIGNATURE\" /\u0026gt;\n            \n            \u0026lt;!-- Also required for the Chartboost SDK. --\u0026gt;\n            \u0026lt;activity android:name=\"com.chartboost.sdk.CBImpressionActivity\"\n                                      android:excludeFromRecents=\"true\" \n                                      android:theme=\"@android:style/Theme.Translucent.NoTitleBar\"\n                                      android:configChanges=\"fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen\" /\u0026gt;\n            \u0026lt;!-- For Google Play Services (required by Chartboost) --\u0026gt;\n            \u0026lt;meta-data android:name=\"com.google.android.gms.version\"\n                                      android:value=\"@integer/google_play_services_version\" /\u0026gt;\n        \u0026lt;/application\u0026gt;\n    \u0026lt;/manifest\u0026gt;\n]]\u0026gt;\u0026lt;/manifestAdditions\u0026gt;\n\u003c/pre\u003e\n\u003cp\u003eAndroid developers: Note also that if you are using another plugin that includes Google Play Services, you may get an error while building. Use the provided ANE that is free of Google Play Services if you want to avoid this conflict.\u003c/p\u003e\n\u003chr /\u003e\n\u003ch3 id=\"int\"\u003eInteracting With Chartboost\u003c/h3\u003e\n\u003ch5\u003eChartboost Setup\u003c/h5\u003e\n\u003cp\u003eFirst, import the Chartboost classes:\u003c/p\u003e\n\u003cpre class=\"prettyprint\"\u003eimport com.chartboost.plugin.air.*;\n\u003c/pre\u003e\n\u003cp\u003eWe recommend making a variable in your class to store a reference to the global Chartboost instance:\u003c/p\u003e\n\u003cpre class=\"prettyprint\"\u003eprivate var chartboost:Chartboost;\n\n// later...\nchartboost = Chartboost.getInstance();\n\u003c/pre\u003e\n\u003cp\u003eTo initialize Chartboost, call the \u003ccode\u003einit()\u003c/code\u003e method with your Chartboost app ID and app signature. You'll probably need to call it conditionally for different platforms, so we've provided some helper functions for you to use:\u003c/p\u003e\n\u003cpre class=\"prettyprint\"\u003eif (Chartboost.isAndroid()) {\n    chartboost.init(\"ANDROID_APP_ID\", \"ANDROID_APP_SIGNATURE\");\n} else if (Chartboost.isIOS()) {\n    chartboost.init(\"IOS_APP_ID\", \"IOS_APP_SIGNATURE\");\n}\n\u003c/pre\u003e\n\u003ch5\u003eCalling Chartboost Methods\u003c/h5\u003e\n\u003cp\u003eIn \u003ccode\u003e/actionscript/src/com/chartboost/plugin/air/Chartboost.as\u003c/code\u003e, you'll find the AIR-to-native methods used to interact with the Chartboost plugin:\u003c/p\u003e\n\u003cpre class=\"prettyprint\"\u003e/** Initializes the Chartboost plugin and, on iOS, records the beginning of a user session */\npublic function init(appID:String, appSignature:String):void\n\n/** Listen to a delegate event from the ChartboostEvent class. See the documentation\n * of the event you choose for the arguments and return value of the function you provide. */\npublic function addDelegateEvent(eventName:String, listener:Function):void\n\n/** Caches an interstitial. */\npublic function cacheInterstitial(location:String):void\n\n/** Shows an interstitial. */\npublic function showInterstitial(location:String):void\n\n/** Checks to see if an interstitial is cached. */\npublic function hasInterstitial(location:String):Boolean\n\n/** Caches the MoreApps page. */\npublic function cacheMoreApps(location:String):void\n\n/** Shows the MoreApps page. */\npublic function showMoreApps(location:String):void\n\n/** Checks to see if the MoreApps page is cached. */\npublic function hasMoreApps(location:String):Boolean\n\n/** Caches the rewarded video. */\npublic function cacheRewardedVideo(location:String):void\n\n/** Shows the rewarded video. */\npublic function showRewardedVideo(location:String):void\n\n/** Checks to see if the rewarded video is cached. */\npublic function hasRewardedVideo(location:String):Boolean\n        \n/** Call this as a result of whatever UI you show in response to the\n * delegate method didPauseClickForConfirmation() */\npublic function didPassAgeGate(pass:Boolean):void\n\n/** Custom settings */\npublic function setCustomID(customID:String):void\npublic function getCustomID():String\n\n/** Set whether interstitials will be requested in the first user session */\npublic function setShouldRequestInterstitialsInFirstSession(shouldRequest:Boolean):void\n\n/** Set whether or not to use the age gate feature.\n * Call Chartboost.didPassAgeGate() to provide your user's response. */\npublic function setShouldPauseClickForConfirmation(shouldPause:Boolean):void\n\n/** Set whether the MoreApps page will have a full-screen loading view. */\npublic function setShouldDisplayLoadingViewForMoreApps(shouldDisplay:Boolean):void\n\n/** Set whether video content is prefetched */\npublic function setShouldPrefetchVideoContent(shouldPrefetch:Boolean):void\n\n/** Control whether ads are automatically cached when possible (default: true). */\npublic function setAutoCacheAds(shouldCache:Boolean):void\npublic function getAutoCacheAds():Boolean\n        \n/** Chartboost in-app purchase analytics */\npublic function trackIOSInAppPurchaseEvent(receipt:String, title:String, description:String, price:Number, currency:String, productID:String):void\npublic function trackGooglePlayInAppPurchaseEvent(title:String, description:String, price:String, currency:String, productID:String, purchaseData:String, purchaseSignature:String):void\npublic function trackAmazonStoreInAppPurchaseEvent(title:String, description:String, price:String, currency:String, productID:String, userID:String, purchaseToken:String):void\n\n\u003c/pre\u003e\n\u003ch5\u003eListening to Chartboost Events\u003c/h5\u003e\n\u003cp\u003eChartboost fires many different events to inform you of the status of impressions. In order to react these events, you must explicitly listen for them. The best place to do this is the initialization code for your active screen:\u003c/p\u003e\n\u003cpre class=\"prettyprint\"\u003e// in some initializing code\nchartboost.addDelegateEvent(ChartboostEvent.DID_CLICK_INTERSTITIAL, function (location:String):void {\n    trace( \"Chartboost: on Interstitial clicked: \" + location );\n});\n\u003c/pre\u003e\n\u003cp\u003eIn \u003ccode\u003e/actionscript/src/com/chartboost/plugin/air/ChartboostEvent.as\u003c/code\u003e, you'll find all the events that are available to listen to:\u003c/p\u003e\n\u003cpre class=\"prettyprint\"\u003e  \n/** Fired when an interstitial fails to load.\n * Arguments: (location:String, error:CBLoadError) */\npublic static const DID_FAIL_TO_LOAD_INTERSTITIAL:String = \"didFailToLoadInterstitial\";\n\n/** Fired when an interstitial is to display. Return whether or not it should.\n * Arguments: (location:String)\n * Returns: Boolean */\npublic static const SHOULD_DISPLAY_INTERSTITIAL:String = \"shouldDisplayInterstitial\";\n\n/** Fired when an interstitial is finished via any method.\n  * This will always be paired with either a close or click event.\n * Arguments: (location:String) */\npublic static const DID_CLICK_INTERSTITIAL:String = \"didClickInterstitial\";\n\n/** Fired when an interstitial is closed\n  * (i.e. by tapping the X or hitting the Android back button).\n * Arguments: (location:String) */\npublic static const DID_CLOSE_INTERSTITIAL:String = \"didCloseInterstitial\";\n\n/** Fired when an interstitial is clicked.\n * Arguments: (location:String) */\npublic static const DID_DISMISS_INTERSTITIAL:String = \"didDismissInterstitial\";        \n\n/** Fired when an interstitial is cached.\n * Arguments: (location:String) */\npublic static const DID_CACHE_INTERSTITIAL:String = \"didCacheInterstitial\";\n\n/** Fired when an interstitial is shown.\n * Arguments: (location:String) */\npublic static const DID_DISPLAY_INTERSTITIAL:String = \"didDisplayInterstitial\";\n\n/** Fired when the MoreApps page fails to load.\n * Arguments: (location:String, error:CBLoadError) */\npublic static const DID_FAIL_TO_LOAD_MOREAPPS:String = \"didFailToLoadMoreApps\";\n\n/** Fired when the MoreApps page is to display. Return whether or not it should.\n * Arguments: (location:String) */\npublic static const SHOULD_DISPLAY_MOREAPPS:String = \"shouldDisplayMoreApps\";\n\n/** Fired when the MoreApps page is finished via any method.\n  * This will always be paired with either a close or click event.\n * Arguments: (location:String)\n * Returns: Boolean */\npublic static const DID_CLICK_MORE_APPS:String = \"didClickMoreApps\";\n\n/** Fired when the MoreApps page is closed\n  * (i.e. by tapping the X or hitting the Android back button).\n * Arguments: (location:String) */\npublic static const DID_CLOSE_MORE_APPS:String = \"didCloseMoreApps\";\n\n/** Fired when a listing on the MoreApps page is clicked.\n * Arguments: (location:String) */\npublic static const DID_DISMISS_MORE_APPS:String = \"didDismissMoreApps\";\n\n/** Fired when the MoreApps page is cached.\n * Arguments: (location:String) */\npublic static const DID_CACHE_MORE_APPS:String = \"didCacheMoreApps\";\n\n/** Fired when the MoreApps page is shown.\n * Arguments: (location:String) */\npublic static const DID_DISPLAY_MORE_APPS:String = \"didDisplayMoreApps\";\n\n/** Fired after a click is registered, but the user is not forwarded to the IOS App Store.\n * Arguments: (location:String, error:CBClickError) */\npublic static const DID_FAIL_TO_RECORD_CLICK:String = \"didFailToRecordClick\";\n\n/** Fired when a rewarded video is cached.\n * Arguments: (location:String) */\npublic static const DID_CACHE_REWARDED_VIDEO:String = \"didCacheRewardedVideo\";\n\n/** Fired when a rewarded video is clicked.\n * Arguments: (location:String) */\npublic static const DID_CLICK_REWARDED_VIDEO:String = \"didClickRewardedVideo\";\n\n/** Fired when a rewarded video is closed.\n * Arguments: (location:String) */\npublic static const DID_CLOSE_REWARDED_VIDEO:String = \"didCloseRewardedVideo\";\n\n/** Fired when a rewarded video completes.\n * Arguments: (location:String, reward:int) */\npublic static const DID_COMPLETE_REWARDED_VIDEO:String = \"didCompleteRewardedVideo\";\n\n/** Fired when a rewarded video is dismissed.\n * Arguments: (location:String) */\npublic static const DID_DISMISS_REWARDED_VIDEO:String = \"didDismissRewardedVideo\";\n\n/** Fired when a rewarded video fails to load.\n * Arguments: (location:String, error:CBLoadError) */\npublic static const DID_FAIL_TO_LOAD_REWARDED_VIDEO:String = \"didFailToLoadRewardedVideo\";\n\n/** Fired when a rewarded video is to display. Return whether or not it should.\n * Arguments: (location:String)\n * Returns: Boolean */\npublic static const SHOULD_DISPLAY_REWARDED_VIDEO:String = \"shouldDisplayRewardedVideo\";\n\n/** Fired right after a rewarded video is displayed.\n * Arguments: (location:String) */\npublic static const DID_DISPLAY_REWARDED_VIDEO:String = \"didDisplayRewardedVideo\";\n\n/** Fired when a video is about to be displayed.\n * Arguments: (location:String) */\npublic static const WILL_DISPLAY_VIDEO:String = \"willDisplayVideo\";\n\n/** Fired if Chartboost plugin pauses click actions awaiting confirmation from the user.\n * Arguments: None */\npublic static const DID_PAUSE_CLICK_FOR_COMFIRMATION:String = \"didPauseClickForConfirmation\";\n\n/** iOS only: Fired when the App Store sheet is dismissed, when displaying the embedded app sheet.\n * Arguments: None */\npublic static const DID_COMPLETE_APP_STORE_SHEET_FLOW:String = \"didCompleteAppStoreSheetFlow\";\n\u003c/pre\u003e\n\u003chr /\u003e\u003c\n\u003ch3 id=\"test\"\u003eTesting Your Integration\u003c/h3\u003e\n\u003cp\u003eTo test the setup, \u003ca href=\"https://answers.chartboost.com/hc/en-us/articles/201219605\" target=\"_blank\"\u003estart a publishing campaign\u003c/a\u003e, add the app you've been integrating with the plugin to the campaign, then build your project to a device.\u003c/p\u003e\n\u003cp\u003eIf you can see Chartboost test interstitials where you've called for them in your code, you're good to go! \u003cstrong\u003eBe sure to disable Test Mode (from the\u003c/strong\u003e App Settings \u003cstrong\u003epage) so you can see actual network ads:\u003c/strong\u003e\u003c/p\u003e\n\u003cp class=\"screenshot\"\u003e\u003cimg src=\"https://s3.amazonaws.com/chartboost/help_assets/en-us/ios+integration+1.jpg\" alt=\"\" /\u003e\u003c/p\u003e\n\u003chr /\u003e\n\u003ch3 id=\"support\"\u003eChartboost Support\u003c/h3\u003e\n\u003cp\u003eMore comprehensive documentation on the Chartboost Adobe AIR Plugin as well as the entire Chartboost system can be found at the \u003ca href=\"https://answers.chartboost.com\" target=\"_blank\"\u003eChartboost Help Site\u003c/a\u003e. You can also use the help site to contact the Chartboost Support Team if you're still experiencing any issues or have questions beyond the scope of the documentation.\u003c/p\u003e\n","funding_links":[],"categories":["Native Extension","AIR Native Extensions"],"sub_categories":["API ANE"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChartBoost%2Fair","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChartBoost%2Fair","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChartBoost%2Fair/lists"}