调整 测试广告位

This commit is contained in:
Jin857 2024-11-27 09:19:05 +08:00
parent 61f484c80c
commit ae47b75a30
3 changed files with 21 additions and 79 deletions

View File

@ -47,7 +47,6 @@ internal class SplashAdView(
}
private fun loadSplashAd() {
LogUtil.e("codeId: $codeId , fetchDelay: $fetchDelay")
splashAD = SplashAD(activity, codeId, this, fetchDelay)
mContainer?.removeAllViews()
splashAD?.fetchAdOnly()

View File

@ -1,10 +1,9 @@
/// 广
class AdsConfig {
static String androidAppId = "1208618114";
static String androidAppId = "1208641399";
static String iosAppId = "1208619454";
// static String androidSplashId = "5172884622215995";
static String androidSplashId = "1122289510576542";
static String androidSplashId = "8192585647453217";
static String iosSplashId = "7142786521331351";
static String androidInterstitialId = "1066865274941328";
@ -19,7 +18,7 @@ class AdsConfig {
static String iosInterstitialRewardVideoId = "9022927550132316";
/// 广id
static String androidRewardVideoId = "7162486540988491";
static String androidRewardVideoId = "5162488667064787";
static String iosRewardVideoId = "6102886561536594";
/// Banner 广id

View File

@ -30,35 +30,35 @@ class _HomePageState extends State<HomePage> {
//广
flutterTencentadRewardCallBack: FlutterUnionAdRewardCallBack(
onShow: () {
print("激励广告显示");
debugPrint("激励广告显示");
},
onClick: () {
print("激励广告点击");
debugPrint("激励广告点击");
},
onFail: (code, message) {
print("激励广告失败 $code $message");
debugPrint("激励广告失败 $code $message");
},
onClose: () {
print("激励广告关闭");
debugPrint("激励广告关闭");
},
onReady: () async {
print("激励广告预加载准备就绪");
debugPrint("激励广告预加载准备就绪");
await FlutterUnionAd.showRewardVideoAd();
},
onUnReady: () {
print("激励广告预加载未准备就绪");
debugPrint("激励广告预加载未准备就绪");
},
onVerify: (transId, rewardName, rewardAmount) {
print("激励广告奖励 $transId $rewardName $rewardAmount");
debugPrint("激励广告奖励 $transId $rewardName $rewardAmount");
},
onExpose: () {
print("激励广告曝光");
debugPrint("激励广告曝光");
},
onFinish: () {
print("激励广告完成");
debugPrint("激励广告完成");
},
onECPM: (ecpmLevel, ecpm) async {
print("激励广告竞价 ecpmLevel=$ecpmLevel ecpm=$ecpm");
debugPrint("激励广告竞价 ecpmLevel=$ecpmLevel ecpm=$ecpm");
//
if (ecpm > 0) {
//Integer
@ -70,56 +70,12 @@ class _HomePageState extends State<HomePage> {
//广 FlutterTencentAdBiddingLossReason
//ID FlutterTencentAdADNID
await FlutterUnionAd.showRewardVideoAd(
result: FlutterUnioAdBiddingResult().fail(
1000,
FlutterTencentAdBiddingLossReason.LOW_PRICE,
FlutterTencentAdADNID.othoerADN));
}
},
),
flutterTencentadInteractionCallBack: FlutterUnionAdInteractionCallBack(
onShow: () {
print("插屏广告显示");
},
onClick: () {
print("插屏广告点击");
},
onFail: (code, message) {
print("插屏广告失败 $code $message");
},
onClose: () {
print("插屏广告关闭");
},
onExpose: () {
print("插屏广告曝光");
},
onReady: () async {
print("插屏广告预加载准备就绪");
await FlutterUnionAd.showUnifiedInterstitialAD();
},
onUnReady: () {
print("插屏广告预加载未准备就绪");
},
onVerify: (transId, rewardName, rewardAmount) {
print("插屏广告奖励凭证id $transId");
},
onECPM: (ecpmLevel, ecpm) async {
print("插屏广告竞价 ecpmLevel=$ecpmLevel ecpm=$ecpm");
//
if (ecpm > 0) {
//Integer
//Integer
await FlutterUnionAd.showUnifiedInterstitialAD(
result: FlutterUnioAdBiddingResult().success(ecpm, 0));
} else {
//Integer
//广 FlutterTencentAdBiddingLossReason
//ID FlutterTencentAdADNID
await FlutterUnionAd.showUnifiedInterstitialAD(
result: FlutterUnioAdBiddingResult().fail(
1000,
FlutterTencentAdBiddingLossReason.LOW_PRICE,
FlutterTencentAdADNID.othoerADN));
result: FlutterUnioAdBiddingResult().fail(
1000,
FlutterTencentAdBiddingLossReason.LOW_PRICE,
FlutterTencentAdADNID.othoerADN,
),
);
}
},
),
@ -141,9 +97,8 @@ class _HomePageState extends State<HomePage> {
Text('当前版本: $adVersion'),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const SizedBox(height: 20),
ElevatedButton(
child: const Text('开屏(全屏)'),
onPressed: () {
@ -151,17 +106,6 @@ class _HomePageState extends State<HomePage> {
setState(() {});
},
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ElevatedButton(
child: const Text('插屏激励'),
onPressed: () {
showInterstitialAd();
},
),
const SizedBox(height: 20),
ElevatedButton(
child: const Text('激励视频'),
@ -206,7 +150,7 @@ class _HomePageState extends State<HomePage> {
/// 广
Future<void> showSplashAd(context) async {
Navigator.push(
await Navigator.push(
context,
MaterialPageRoute(
builder: (_) {