Skip to content
On this page

激励视频广告

*激励视频回调说明

// 激励视频广告加载成功
- (void)juHeBaoRewardedVideoAdDidLoad:(JuHeBaoRewardVideoAd *_Nonnull)rewardedVideoAd;

//激励视频广告加载失败
- (void)juHeBaoRewardedVideoAd:(JuHeBaoRewardVideoAd *_Nonnull)rewardedVideoAd didFailWithError:(NSError *_Nullable)error;

//激励视频成功缓存时会调用此方法。
- (void)juHeBaoRewardedVideoAdDidDownLoadVideo:(JuHeBaoRewardVideoAd *_Nonnull)rewardedVideoAd;

//激励视频广告展示失败回调
- (void)juHeBaoRewardedVideoAdDidShowFailed:(JuHeBaoRewardVideoAd *_Nonnull)rewardedVideoAd error:(NSError *_Nonnull)error;

//激励视频广告位已显示
- (void)juHeBaoRewardedVideoAdDidVisible:(JuHeBaoRewardVideoAd *_Nonnull)rewardedVideoAd;

//激励视频广告关闭
- (void)juHeBaoRewardedVideoAdDidClose:(JuHeBaoRewardVideoAd *_Nonnull)rewardedVideoAd;

//单击激励视频广告
- (void)juHeBaoRewardedVideoAdDidClick:(JuHeBaoRewardVideoAd *_Nonnull)rewardedVideoAd;

//激励视频用户单击“跳过”按钮
- (void)juHeBaoRewardedVideoAdDidClickSkip:(JuHeBaoRewardVideoAd *_Nonnull)rewardedVideoAd;

//激励视频广告播放完成或出现错误
- (void)juHeBaoRewardedVideoAdDidPlayFinish:(JuHeBaoRewardVideoAd *_Nonnull)rewardedVideoAd didFailWithError:(NSError *_Nullable)error;

*激励视频广告使用示例
广告加载
1.Objective-C

- (void)loadRewardedVideoAd {
    JuHeBaoRewardedVideoAd *juHeBaoRewardedVideoAd = [[JuHeBaoRewardedVideoAd alloc] init];
    juHeBaoRewardedVideoAd.slotID = @"";
    juHeBaoRewardedVideoAd.delegate = self;

    [juHeBaoRewardedVideoAd loadJuHeBaoAdData];
}

2.Swift

let juHeBaoRewardedVideoAd = JuHeBaoRewardedVideoAd()
    func loadRewardedVideoAd(){
        self.juHeBaoRewardedVideoAd.slotID = ""
        self.juHeBaoRewardedVideoAd.delegate = self


        self.juHeBaoRewardedVideoAd.loadJuHeBaoAdData()
    }

广告展示
1.Objective-C

[self.juHeBaoRewardedVideoAd showFromRootViewController:self];

2.Swift

self.juHeBaoRewardedVideoAd.show(fromRootViewController: self)