💰 Unofficial Chartboost ads support for Haxe/OpenFL Android and iOS targets
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dependencies/samcodes-chartboost
extension/chartboost
ndll
project
.travis.yml
CHANGELOG.md
LICENSE
README.md
haxelib.json
include.xml
package.bat

README.md

Haxe Chartboost

Travis Build Status License

Unofficial Chartboost ads library support for OpenFL Android and iOS targets. See the demo app here.

Features

Supports:

  • Static and video interstitials.
  • Rewarded videos.
  • Ad caching and custom ad locations.
  • Customizable listener for reacting to all SDK events.

Doesn't support:

  • Chartboost InPlay type ads.
  • Chartboost Analytics.
  • Age gates.

If there is something you would like adding please open an issue. Pull requests welcomed too!

Install

haxelib install samcodes-chartboost

Example

See the demo app for a complete example using a custom listener.

Screenshot of demo app

Screenshot of demo app

Usage

Include the haxelib through Project.xml:

<haxelib name="samcodes-chartboost" />

To use test ads, first ensure "test mode" is enabled on your Chartboost app dashboard.

For Android, set the app identifier and signature in the Project.xml file:

<!-- Enter your app id and app signatures here -->
<setenv name="ChartboostAppId" value="YOUR_ID" if="android" />
<setenv name="ChartboostAppSignature" value="YOUR_SIG" if="android" />

For iOS, pass the app identifier and signature in AdsWrapper.hx:

Chartboost.initChartboost(yourAppId, yourAppSignature);
// Basic usage
Chartboost.setListener(new MyChartboostListener(listener)); // Attach your own ChartboostListener subclass to handle/respond to SDK events like 'willDisplayInterstitial', 'didDismissInterstitial' etc.

Chartboost.cacheInterstitial("mylocation"); // Cache an interstitial at 'mylocation'. Locations are added to the Chartboost dashboard automatically.

Chartboost.showInterstitial("mylocation"); // Show an interstitial at 'mylocation'. Will display faster if previously cached (check Chartboost.hasInterstitial()).

// And so on...

Notes

If in doubt, refer to the official Chartboost documentation.

Use #if (android || ios) conditionals around your imports and calls to this library for cross platform projects - there is no stub/fallback implementation included in the haxelib.

If you need to rebuild the iOS or simulator ndlls, navigate to /project and run rebuild_ndlls.sh.