unity_ads_plugin 0.0.1 unity_ads_plugin: ^0.0.1 copied to clipboard
Unity Ads plugin for Flutter Applications (Android).
unity_ads #
Unity Ads plugin for Flutter Applications (Android).
Getting Started #
1. Initialization: #
UnityAds.init(gameId: "game_id", testMode: true);
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!');
}
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!');
}
},
);