| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import 'dart:io';
- import 'package:flutter/foundation.dart';
- import '../config/config.dart';
- class AdHelper {
- ////////////////// applovin //////////////////
- // applovin ad sdk 初始化需要的sdkkey
- static String get applovinSdkKey => 'Re0UgCOtX5ilJER-0B4LpK-5cR4iPs1sU2LAFk1nqlW7zz6-9BJyWI28k6r8yt-RvKc82dwtMQ-KO5IXHcUpvW';
- static String get applovinBannerAdUnitId {
- if (Platform.isAndroid) {
- if (kReleaseMode && !Config.isDebug) return '8bc21670e20e8f18';
- return '8bc21670e20e8f18'; // test id
- } else if (Platform.isIOS) {
- if (kReleaseMode && !Config.isDebug) return '8bc21670e20e8f18';
- return '8bc21670e20e8f18'; // test id
- } else {
- return '8bc21670e20e8f18';
- }
- }
- static String get applovinInterstitialAdUnitId {
- if (Platform.isAndroid) {
- if (kReleaseMode && !Config.isDebug) return 'ace63b1d8232da10';
- return 'ace63b1d8232da10'; // test id
- } else if (Platform.isIOS) {
- if (kReleaseMode && !Config.isDebug) return 'ace63b1d8232da10';
- return 'ace63b1d8232da10'; // test id
- } else {
- return 'ace63b1d8232da10';
- }
- }
- static String get applovinRewardedAdUnitId {
- if (Platform.isAndroid) {
- if (kReleaseMode && !Config.isDebug) return '9d218c119bc40d06';
- return '9d218c119bc40d06'; // test id
- } else if (Platform.isIOS) {
- if (kReleaseMode && !Config.isDebug) return '9d218c119bc40d06';
- return '9d218c119bc40d06'; // test id
- } else {
- return '9d218c119bc40d06';
- }
- }
- }
- // 定义插屏和激励广告的状态
- enum AdState {
- // 初始状态,广告未加载
- initial,
- // 广告已经ready
- ready,
- // 广告正常显示
- showing,
- // 广告显示异常
- error,
- // 广告视窗关闭
- dismissed,
- }
|