ATiOSIntersitialTS.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import {ATiOSJS} from "./ATiOSJS";
  2. const OC_WRAPPER_CLASS = "ATInterstitialAdWrapper";
  3. export const ATiOSInterstitialJS = {
  4. loadInterstitial : function (placementId, extra) {
  5. ATiOSJS.printJsLog("ATiOSInterstitialJS::loadInterstitial(" + placementId + ", " + extra + ")");
  6. jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "loadInterstitialWithPlacementID:extra:", placementId, extra);
  7. },
  8. setAdListener : function (listener) {
  9. ATiOSJS.printJsLog("ATiOSInterstitialJS::setAdListener(" + listener + ")");
  10. jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "setDelegates:", listener);
  11. },
  12. hasAdReady : function (placementId) {
  13. ATiOSJS.printJsLog("ATiOSInterstitialJS::hasAdReady(" + placementId + ")");
  14. return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "interstitialReadyForPlacementID:", placementId);
  15. },
  16. checkAdStatus : function (placementId) {
  17. ATiOSJS.printJsLog("ATiOSInterstitialJS::checkAdStatus(" + placementId + ")");
  18. return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "checkAdStatus:", placementId);
  19. },
  20. setUserData : function (placementId, userId, userData) {
  21. cc.log("Android-setUserData");
  22. },
  23. showAd : function(placementId) {
  24. ATiOSJS.printJsLog("ATiOSInterstitialJS::showAd(" + placementId + ")");
  25. return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showInterstitialWithPlacementID:scene:", placementId, null);
  26. },
  27. showAdInScenario : function(placementId, scenario) {
  28. ATiOSJS.printJsLog("ATiOSInterstitialJS::showAd(" + placementId + ", " + scenario + ")");
  29. return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showInterstitialWithPlacementID:scene:", placementId, scenario);
  30. },
  31. entryAdScenario : function(placementId, scenario) {
  32. ATiOSJS.printJsLog("ATiOSInterstitialJS::entryAdScenario(" + placementId + ", " + scenario + ")");
  33. return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "entryAdScenarioWithPlacementID:scene:", placementId, scenario);
  34. }
  35. };