//
//  HLAdInterstitial.h
//  HLAdsDemo
//
//  Created by Liubin on 2025/10/11.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class HLAdInterstitial;

@protocol HLAdInterstitialDelegate <NSObject>

/// 广告开始加载
- (void)interstitialAdDidStart:(HLAdInterstitial *)interstitialAd;

///  获取广告成功
- (void)interstitialAdLoadSuccess:(HLAdInterstitial *)interstitialAd;

///  广告成功展示
- (void)interstitialAdDidShow:(HLAdInterstitial *)interstitialAd;

/// 获取广告失败
/// @param error 失败原因
- (void)interstitialAdLoadFailed:(NSError*)error interstitialAd:(HLAdInterstitial *)interstitialAd;

/// 广告点击事件
- (void)interstitialAdDidClick:(HLAdInterstitial *)interstitialAd;

/// 广告关闭事件
- (void)interstitialAdDidClose:(HLAdInterstitial *)interstitialAd;

/// 内置浏览器打开
- (void)interstitialAdStartWebBrower:(HLAdInterstitial *)interstitialAd;

/// 内置浏览器关闭
- (void)interstitialAdWebBrowerDidClose:(HLAdInterstitial *)interstitialAd;

/// deeplink跳转App
- (void)interstitialAdViewDidOpenApp:(HLAdInterstitial *)interstitialAd;


@end


@interface HLAdInterstitial : UIView

@property (weak, nonatomic) id<HLAdInterstitialDelegate> delegate;

/**
 * 初始化插屏广告
 * @param placementID 广告位ID
 * @param adSize 广告尺寸
 */
- (instancetype)initWithPlacementID:(NSString *)placementID
                             adSize:(CGSize)adSize;

/**
 * 加载广告，不展示
 */
- (void)loadAd;

/**
 * 展示广告
 * @param viewController : 必须传入用于显示插屏广告的UIViewController
*/
- (void)showWithViewController:(UIViewController *)viewController;


/// 广告ecmp，单位：分
- (CGFloat)adEcpm;



@end




NS_ASSUME_NONNULL_END
