24 lines
765 B
Dart
24 lines
765 B
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:unity_ads_plugin/unity_ads_plugin.dart';
|
|
|
|
void loadUnityInterAd(String placementId) {
|
|
UnityAds.load(placementId: placementId, onComplete: (placementId) {}, onFailed: (placementId, error, message) {});
|
|
}
|
|
|
|
void showUnityInterstitialAds(String placementId) {
|
|
UnityAds.showVideoAd(
|
|
placementId: placementId,
|
|
onComplete: (placementId) {
|
|
loadUnityInterAd(placementId);
|
|
},
|
|
onFailed: (placementId, error, message) {
|
|
loadUnityInterAd(placementId);
|
|
},
|
|
onStart: (placementId) => debugPrint('Video Ad $placementId started'),
|
|
onClick: (placementId) => debugPrint('Video Ad $placementId click'),
|
|
onSkipped: (placementId) {
|
|
loadUnityInterAd(placementId);
|
|
},
|
|
);
|
|
}
|