Skip to content

💰 Unofficial Chartboost ads support for Haxe/OpenFL Android and iOS targets

License

Notifications You must be signed in to change notification settings

filipp8/samcodes-chartboost

 
 

Repository files navigation

Haxe Chartboost

Travis Build Status License

Unofficial Chartboost ads library support for Haxe 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.
  • GDPR personal data consent method bindings.

Doesn't support:

  • Chartboost InPlay type ads.
  • Chartboost Analytics.
  • iOS banner ads.
  • 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" />

On Android and iOS, pass the app identifier and signature in for your chosen app/platform when initializing Chartboost:

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

  • 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.
  • You may need to edit the build.gradle file in order to select working combinations of the Android support library and Play Services, depending on your targeted SDK versions and other libraries used in your project.
  • If you need to rebuild the iOS or simulator ndlls, navigate to /project and run rebuild_ndlls.sh.
  • Got an idea or suggestion? Open an issue on GitHub, or send Sam a message on Twitter.

About

💰 Unofficial Chartboost ads support for Haxe/OpenFL Android and iOS targets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 84.0%
  • Haxe 8.8%
  • Objective-C++ 4.4%
  • C++ 2.6%
  • Other 0.2%