开屏广告接入代码

1. 包含头文件 AdHubSDK.h

2. AdHubSplash 的创建和初始化

// 开屏的创建与初始化
_splash = [[AdHubSplash alloc] initWithSpaceID:[DemoIDData sharedInstance].splashSpaceID spaceParam:[DemoIDData sharedInstance].splashSpaceParam];
_splash.delegate = self;

// 开屏请求开始
[_splash loadAndDisplayUsingContainerView:splashContainer];

3. AdHubSplash 主要属性说明

//广告位 id 在AdHub后台创建产生
@property(nonatomic, readonly, copy) NSString *spaceID;
//填写任意字符串
@property(nonatomic, readonly, copy) NSString *spaceParam;

/**
 用来接收开屏广告读取和展示状态变化通知的 delegate
 */
@property(nonatomic, weak) id<AdHubSplashDelegate> delegate;
/**
 开屏广告是否加载完毕
 */
@property(nonatomic, readonly, assign) BOOL isReady;

4. AdHubSplashDelegate 的方法说明

@required
/**
 @return 展现开屏点击二跳所需的 UIViewController,不能为空
 */
- (UIViewController *)adSplashViewControllerForPresentingModalView;

@optional
/**
 开屏请求成功
 */
- (void)splashDidReceiveAd:(AdHubSplash *)ad;

/**
 开屏请求失败
 */
- (void)splash:(AdHubSplash *)ad didFailToLoadAdWithError:(AdHubRequestError *)error;

/**
 开屏展现
 */
- (void)splashDidPresentScreen:(AdHubSplash *)ad;

/**
 开屏点击 landingPageURL 为空时说明有详情页
 点击广告, 手动调用 splashCloseAd 会移除当前广告展示
 */
- (void)splashDidClick:(NSString *)landingPageURL;

/**
 开屏消失
 */
- (void)splashDidDismissScreen:(AdHubSplash *)ad;

results matching ""

    No results matching ""