调整 测试广告位
This commit is contained in:
parent
61f484c80c
commit
ae47b75a30
@ -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()
|
||||
|
@ -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
|
||||
|
@ -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: (_) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user