2024-06-07 11:41:02 +08:00

207 lines
5.2 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// BaiduMobAdSplash.h
// BaiduMobAdSDK
//
// Created by LiYan on 16/5/25.
// Copyright © 2016年 Baidu Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BaiduMobAdSplashDelegate.h"
#import "BaiduMobAdFeedRequestParameters.h"
@interface BaiduMobAdSplash : NSObject
/**
* 委托对象
*/
@property (nonatomic, weak) id <BaiduMobAdSplashDelegate> delegate;
/**
* 开屏点睛-卡片样式delegate
*/
@property (nonatomic, weak) id <BaiduMobAdSplashCardViewDelegate> cardDelegate;
/**
* 开屏点睛-icon样式delegate
*/
@property (nonatomic, weak) id <BaiduMobAdSplashFocusZoomOutViewDelegate> zoomOutDelegate;
/**
* 是否支持开屏点睛-卡片样式
* 广告返回后获取不可set
*/
@property (nonatomic, assign, readonly) BOOL hasCardView;
/**
* 是否支持开屏点睛-icon样式
* 广告返回后获取不可set
*/
@property (nonatomic, assign, readonly) BOOL hasZoomOutView;
/**
* 设置/获取代码位id
*/
@property (nonatomic, copy) NSString *AdUnitTag;
/**
* 设置开屏广告是否可以点击的属性,开屏默认可以点击。
*/
@property (nonatomic, assign) BOOL canSplashClick;
/**
* SDK版本
*/
@property (nonatomic, readonly) NSString *version;
/**
* 广告请求超时时间默认3s单位s
*/
@property (nonatomic, assign) NSTimeInterval timeout;
/**
* 广告渲染视图大小必须大于200*200
*/
@property (nonatomic, assign) CGSize adSize;
/**
* 使用controller present 落地页
*/
@property (nonatomic, weak) UIViewController *presentAdViewController;
/**
* 设置摇一摇的尺寸高或宽摇一摇默认69pt
*/
@property (nonatomic, assign) CGFloat shakeImageViewSize;
/**
* 设置扭一扭图片的尺寸高默认63pt
*/
@property (nonatomic, assign) CGFloat twistImageViewSize;
//扭一扭蒙层颜色
@property (nonatomic, strong) UIColor *twistMaskColor;
/**
* 设置底价过滤支持客户端与服务端bidding配置
* 仅支持整数值,单位:分
*/
@property (nonatomic, assign) int bidFloor;
/**
* 开屏传参
*/
@property (nonatomic, strong) BaiduMobAdFeedRequestParameters *requestParameters;
/**
* 请求并展示开屏广告广告尺寸以传入window大小为准
*/
- (void)loadAndDisplayUsingKeyWindow:(UIWindow *)keyWindow;
/**
* 请求并展示半屏开屏广告广告尺寸以传入view大小为准
*/
- (void)loadAndDisplayUsingContainerView:(UIView *)view;
/**
* 展示开屏点睛-卡片样式
* 注意若渲染该样式需要实现cardDelegate
* 不要释放开屏对象,否则回调无法正常回调
* @param viewController 用于展示卡片的VC
*/
- (void)showCardViewInViewController:(UIViewController *)viewController;
/**
* 展示开屏点睛-icon样式
* 注意若渲染该样式需要实现zoomOutDelegate
* 不要释放开屏对象,否则回调无法正常回调
* @param viewController 用于展示卡片的VC
*/
- (void)showZoomOutViewInViewController:(UIViewController *)viewController;
/**
* 展示广告
* @param viewController 展示广告所在的VC
*/
- (void)showSplashViewInViewController:(UIViewController *)viewController;
/**
* 请求开屏广告仅请求不做展示需要手动调用show展示广告
* load之前请先设置开屏渲染视图大小adSize
*/
- (void)load;
/**
* 展示广告
*/
- (void)showInContainerView:(UIView *)view;
/**
* 重置广告容器大小
*/
- (void)resizeLayout;
/**
* 开屏广告自定义相关配置字段
*/
- (NSString *)getExtData;
/**
* 广告价格标签
*/
- (NSString *)getECPMLevel;
/**
* 竞价成功,上报竞价失败排名第二的信息
* @param secondInfo 竞败方,排名第二的信息
* Keyecpm Value为本次竞败方排名第二的价格单位类型为Integer。选填
* Keyadn Value为本次竞败方排名第二的渠道ID类型为Integer。具体ID枚举见文档
* @param completion 发送成功或失败回调
*/
- (void)biddingSuccessWithSecondInfo:(NSDictionary *)secondInfo completion:(void (^)(BOOL success, NSString *errorInfo))completion;
/**
* 反馈竞价失败及原因,无广告返回时也可用此接口上报竞胜方信息
* @param winInfo 竞胜方的信息
* Keyecpm Value为本次竞胜方出价单位类型为Integer。选填
* Keyadn Value为本次竞胜方渠道ID类型为Integer。具体ID枚举见文档
* @param completion 发送成功或失败回调
*/
- (void)biddingFailWithWinInfo:(NSDictionary *)winInfo completion:(void (^)(BOOL success, NSString *errorInfo))completion;
/**
* 获取Bidding token
* @return 媒体ADX请求广告所需的token
*/
- (NSString *)getBiddingToken;
/**
* 请求bidding广告
* @param bidId 媒体传入竞价成功的广告id
*/
- (void)loadBiddingAd:(NSString *)bidId;
/**
* 销毁开屏,释放资源
*/
- (void)stop;
/**
* 根据key获取广告相关字段
* @param key 需要获取的key字段
* @return 字段的字符串
*/
- (NSString *)getAdDataForKey:(NSString *)key;
#pragma mark - DEPRECATED_ATTRIBUTE
- (void)setBiddingData:(NSString *)data BaiduMobAdDEPRECATED_MSG("已废弃请接入最新的服务端bidding渲染方式");
@end