Note: Currently only Android platform is supported.
Note: AndroidX is required.
Call Adcolony.init();
during app initialization.
AdColony.init(AdColonyOptions('#your_app_id', '0', this.zones));
class AdColonyOptions {
final String id;
final String gdpr;
final List<String> zones;
AdColonyOptions(this.id, this.gdpr, this.zones);
Map<String, dynamic> toJson() =>
{'Id': this.id, 'Gdpr': this.gdpr, 'Zones': this.zones};
}
AdColony.request('#ad_zone', listener);
listener(AdColonyAdListener event) {
if (event == AdColonyAdListener.onRequestFilled)
AdColony.show();
}
BannerView((AdColonyAdListener event) => print(event), BannerSizes.leaderboard, '#ad_zone'),
# For communication with AdColony's WebView
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
# For removing warnings due to lack of Multi-Window support
-dontwarn android.app.Activity
enum AdColonyAdListener {
onRequestFilled,
onRequestNotFilled,
onReward,
onOpened,
onClosed,
onIAPEvent,
onExpiring,
onLeftApplication,
onClicked
}
Implement for iOS platform.