Getting started
UnityAds
TODO: Initialization in void main
Unityads.iniUnit();
TODO: Load Intra Ads
Unityads.unityIntraLoad();
TODO: Show Intra Ads
UnityAds.showVideoAd(
placementId: 'PLACEMENT_ID',
onStart: (placementId) => print('Video Ad $placementId started'),
onClick: (placementId) => print('Video Ad $placementId click'),
onSkipped: (placementId) => print('Video Ad $placementId skipped'),
onComplete: (placementId) => print('Video Ad $placementId completed'),
onFailed: (placementId, error, message) => print('Video Ad $placementId failed: $error $message'),
);
TODO: Show Banner Ads
Unityads.unityBannerShow;
Admob Ads
TODO: Initialization in void main
Googleads.ini;
TODO: add app id in android mainfiest file
<manifest>
<application>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
</application>
</manifest>
TODO: Show Banner Ads
Googleads.BannerAdsShow;
TODO: Load Intra & Rewared Ads
Googleads.loadReward;
Googleads.loadIntra;
TODO: Show Intra
final isLoaded = await interstitialAd.isLoaded;
if (isLoaded ?? false) {
interstitialAd.show();
} else {
showSnackBar(
'Interstitial ad is still loading...');
}
TODO: Show rewared
if (await rewardAd.isLoaded) {
rewardAd.show();
} else {
showSnackBar('Reward ad is still loading...');
}