ad_helper.dart 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import 'dart:io';
  2. class AdHelper {
  3. ////////////////// applovin //////////////////
  4. // applovin ad sdk 初始化需要的sdkkey
  5. static String applovinSdkKey = 'mycRUJHDmgMv3i2NFQ5L5rB_T2y4HBOIIFR7_gpPd3bDCLep4Bb_KfWTsdWTrafiKMQMOyuAGFDOTTmagsk4LM';
  6. static String get applovinBannerAdUnitId {
  7. if (Platform.isAndroid) {
  8. return '0c6a650f98d3832e';
  9. } else if (Platform.isIOS) {
  10. return '';
  11. } else {
  12. return '';
  13. }
  14. }
  15. static String get applovinInterstitialAdUnitId {
  16. if (Platform.isAndroid) {
  17. return 'd072aec9f9a9b4a4';
  18. } else if (Platform.isIOS) {
  19. return '';
  20. } else {
  21. return '';
  22. }
  23. }
  24. static String get applovinRewardedAdUnitId {
  25. if (Platform.isAndroid) {
  26. return '4e4bf93a3a0314d8';
  27. } else if (Platform.isIOS) {
  28. return '';
  29. } else {
  30. return '';
  31. }
  32. }
  33. }
  34. // 定义插屏和激励广告的状态
  35. enum AdState {
  36. // 初始状态,广告未加载
  37. initial,
  38. // 广告已经ready
  39. ready,
  40. // 广告正常显示
  41. showing,
  42. // 广告显示异常
  43. error,
  44. // 广告视窗关闭
  45. dismissed,
  46. }