wechat/ad

ad module provides ad component API bindings details in wechat document

Types

InterstitialAd type

pub type InterstitialAd

RewardedVideoAd type

pub type RewardedVideoAd

Values

pub fn create_interstitial_ad(
  options o: object.JsObject,
) -> InterstitialAd

wx.createInterstitialAd Create interstitial ad instance

pub fn create_rewarded_video_ad(
  options o: object.JsObject,
) -> RewardedVideoAd

wx.createRewardedVideoAd Create rewarded video ad instance

pub fn get_show_splash_ad_status(
  complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))

wx.getShowSplashAdStatus Get splash ad status

pub fn interstitial_ad_destroy(ad: InterstitialAd) -> Nil

InterstitialAd.destroy Destroy ad instance

pub fn interstitial_ad_load(
  ad: InterstitialAd,
  complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))

InterstitialAd.load Load ad

pub fn interstitial_ad_off_close(
  ad: InterstitialAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

InterstitialAd.offClose Remove close event listener

pub fn interstitial_ad_off_error(
  ad: InterstitialAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

InterstitialAd.offError Remove error event listener

pub fn interstitial_ad_off_load(
  ad: InterstitialAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

InterstitialAd.offLoad Remove load event listener

pub fn interstitial_ad_on_close(
  ad: InterstitialAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

InterstitialAd.onClose Listen for close event

pub fn interstitial_ad_on_error(
  ad: InterstitialAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

InterstitialAd.onError Listen for error event

pub fn interstitial_ad_on_load(
  ad: InterstitialAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

InterstitialAd.onLoad Listen for load event

pub fn interstitial_ad_show(
  ad: InterstitialAd,
  complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))

InterstitialAd.show Show ad

pub fn rewarded_video_ad_destroy(ad: RewardedVideoAd) -> Nil

RewardedVideoAd.destroy Destroy ad instance

pub fn rewarded_video_ad_load(
  ad: RewardedVideoAd,
  complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))

RewardedVideoAd.load Load ad

pub fn rewarded_video_ad_off_close(
  ad: RewardedVideoAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

RewardedVideoAd.offClose Remove close event listener

pub fn rewarded_video_ad_off_error(
  ad: RewardedVideoAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

RewardedVideoAd.offError Remove error event listener

pub fn rewarded_video_ad_off_load(
  ad: RewardedVideoAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

RewardedVideoAd.offLoad Remove load event listener

pub fn rewarded_video_ad_on_close(
  ad: RewardedVideoAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

RewardedVideoAd.onClose Listen for close event

pub fn rewarded_video_ad_on_error(
  ad: RewardedVideoAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

RewardedVideoAd.onError Listen for error event

pub fn rewarded_video_ad_on_load(
  ad: RewardedVideoAd,
  callback cb: fn(object.JsObject) -> Nil,
) -> Nil

RewardedVideoAd.onLoad Listen for load event

pub fn rewarded_video_ad_show(
  ad: RewardedVideoAd,
  complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))

RewardedVideoAd.show Show ad

Search Document