InterstitialAdWaiter.cpp 723 B

12345678910111213141516171819202122232425262728
  1. //
  2. // InterstitialAdWaiter.cpp
  3. // redream_runtime
  4. //
  5. // Created by Chao on 2023/5/24.
  6. //
  7. #include "InterstitialAdWaiter.hpp"
  8. #include "AdUtils.h"
  9. namespace redream {
  10. InterstitialAdWaiter* InterstitialAdWaiter::create(ReboltRedManager* rrm, red::RedBehaviacTree* fatherTree, std::string adName) {
  11. InterstitialAdWaiter* waiter = new InterstitialAdWaiter();
  12. waiter->autorelease();
  13. waiter->setFatherTree(fatherTree);
  14. waiter->setReboltRedManager(rrm);
  15. waiter->_adName = adName;
  16. return waiter;
  17. }
  18. void InterstitialAdWaiter::run(ReboltErrorInfo& errorInfo) {
  19. auto callback = [this](){
  20. onSuccessEnd();
  21. };
  22. ad::AdUtils::shared()->getInterstitialUtils()->show(_adName, callback);
  23. }
  24. }