IATNativeAdClient.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using AnyThinkAds.Api;
  5. namespace AnyThinkAds.Common
  6. {
  7. public interface IATNativeAdClient : IATNativeAdEvents
  8. {
  9. /***
  10. * 请求广告
  11. * @param placementId 广告位id
  12. * @parm mapJson 各平台的私有属性 一般可以不调用
  13. */
  14. void loadNativeAd(string placementId, string mapJson);
  15. /***
  16. * 判断是否有广告存在
  17. * 可以在显示广告之前调用
  18. * @param placementId 广告位id
  19. */
  20. bool hasAdReady(string placementId);
  21. /**
  22. * 获取广告状态信息(是否正在加载、是否存在可以展示广告、广告缓存详细信息)
  23. * @param unityid
  24. *
  25. */
  26. string checkAdStatus(string placementId);
  27. /***
  28. *
  29. * 设置监听回调接口
  30. *
  31. * @param listener
  32. */
  33. void setListener(ATNativeAdListener listener);
  34. /***
  35. *
  36. * 展示广告,
  37. * @param placementId
  38. * @param anyThinkNativeAdView 这里的属性是显示区域坐标等配置,需要自行设置
  39. * @parm mapJson
  40. */
  41. void renderAdToScene(string placementId, ATNativeAdView anyThinkNativeAdView, string mapJson);
  42. /***
  43. *
  44. * 清理广告
  45. * @param placementId
  46. * @param anyThinkNativeAdView 这里的属性是显示区域坐标等配置,需要自行设置
  47. */
  48. void cleanAdView(string placementId, ATNativeAdView anyThinkNativeAdView);
  49. /***
  50. * 页面显示
  51. */
  52. void onApplicationForces(string placementId, ATNativeAdView anyThinkNativeAdView);
  53. /***
  54. * 页面隐藏
  55. */
  56. void onApplicationPasue(string placementId, ATNativeAdView anyThinkNativeAdView);
  57. /***
  58. * 清理缓存
  59. */
  60. void cleanCache(string placementId);
  61. /***
  62. * 获取所有可用缓存广告
  63. */
  64. string getValidAdCaches(string placementId);
  65. void entryScenarioWithPlacementID(string placementId, string scenarioID);
  66. }
  67. }