unity_ads_plugin 0.0.2 unity_ads_plugin: ^0.0.2 copied to clipboard
Unity Ads plugin for Flutter Applications (Android). This plugin is able to display Unity Banner Ads and Unity Video Ads.
unity_ads_plugin #
Unity Ads plugin for Flutter Applications (Android). This plugin is able to display Unity Banner Ads and Unity Video Ads.
iOS support is in development.
Getting Started #
1. Initialization: #
UnityAds.init(gameId: "game_id");
Set your Game id.
For testing purposes set testMode
to true
.
2. Show Banner Ad: #
Place UnityBannerAd
widget in your app.
UnityBannerAd(
placementId: "banner_placement_id",
)
3. Show Rewarded Video Ad: #
UnityAds.showVideoAd(
placementId: 'rewarded_video_placement_id',
listener: (state, args) {
if (state == UnityAdState.complete) {
print('User watched a video. User should get a reward!');
} else if (state == UnityAdState.skipped) {
print('User cancel video.');
}
},
);
4. Show Interstitial Video Ad: #
UnityAds.showVideoAd(
placementId: 'video_placement_id',
listener: (state, args) {
if (state == UnityAdState.started) {
print('User started watching the video!');
}
},
);