Page History

Ad_nativead

Last edited by 张旭

原生广告

原生广告为定制化广告类型,为保证APP观感及使用体验,用户通过API接口获取广告物料数据,在内容页面使用广告数据封装展示视图。 开发者需自行处理广告点击事件以及发出广告监测请求,以便第三方监测和统计,点击事件包括网页类型,监测包括曝光监测地址、点击监测地址、转化检测地址三种类型。

获取开屏广告管理类

+ (VLionManager *Nonnull)manager;

原生广告接口定义

/**
 请求原生新闻类型广告模型数据

 @param tagId 广告位id
 @param handler 回调
 */
- (void)vl_nativeAdNewsWithTagId:(NSString *_Nonnull)tagId handler:(VLionNativeAdNewsHandler _Nullable)handler;

/**
 请求原生应用墙类型广告模型数据

 @param tagId 广告位id
 @param handler 回调
 */
- (void)vl_nativeAdAppWallWithTagId:(NSString *_Nonnull)tagId handler:(VLionNativeAdAppWallHandler _Nullable)handler;

/**
 请求原生轮播图类型广告模型数据

 @param tagId 广告位id
 @param handler 回调
 */
- (void)vl_nativeAdShufflingWithTagId:(NSString *_Nonnull)tagId handler:(VLionNativeAdShufflingHandler _Nullable)handler;

/**
 请求原生瀑布流类型广告模型数据

 @param tagId 广告位id
 @param handler 回调
 */
- (void)vl_nativeAdWaterfallWithTagId:(NSString *_Nonnull)tagId handler:(VLionNativeAdWaterfallHandler _Nullable)handler;

/**
 请求原生信息流类型广告模型数据

 @param tagId 广告位id
 @param handler 回调
 */
- (void)vl_nativeAdInformationFlowWithTagId:(NSString *_Nonnull)tagId handler:(VLionNativeAdInformationFlowHandler _Nullable)handler;

/**
 点击原生广告跳转,跳转webView交由SDK内部实现,如果开发者自行实现跳转需要参考瑞狮开发文档替换监测地址,落地页,下载地址监测宏,上传点击监测地址,上传曝光监测地址等

 @param model 原生模型
 @param upPoint 手势离开屏幕坐标(坐标原点为广告视图左上角)
 @param downPoint 手势接触屏幕坐标(坐标原点为广告视图左上角)
 @param viewController 跳转的控制器
 @param adBackBlock 返回回调
 */
- (void)clickNativedAdWithModel:(id _Nonnull)model upPoint:(CGPoint)upPoint downPoint:(CGPoint)downPoint viewController:(UIViewController *_Nonnull)viewController adBackBlock:(void (^_Nullable)(void))adBackBlock;

使用场景

在展示广告的内容页面,调用接口获取原生广告数据,接口回调成功即可将数据合并至展示在页面中。

调用示例

[[VLionManager manager] vl_nativeAdNewsWithTagId:@"800" handler:^(VLionNativeAdNewsModel * _Nullable adModel, NSDictionary * _Nullable errorDic) {
    NSLog(@"model:%@",adModel);
}];

[[VLionManager manager] vl_nativeAdAppWallWithTagId:@"801" handler:^(VLionNativeAdAppWallModel * _Nullable adModel, NSDictionary * _Nullable errorDic) {
}];

[[VLionManager manager] vl_nativeAdShufflingWithTagId:@"802" handler:^(VLionNativeAdShufflingModel * _Nullable adModel, NSDictionary * _Nullable errorDic) {
}];

[[VLionManager manager] vl_nativeAdWaterfallWithTagId:@"803" handler:^(VLionNativeAdWaterfallModel * _Nullable adModel, NSDictionary * _Nullable errorDic) {
}];

[[VLionManager manager] vl_nativeAdInformationFlowWithTagId:@"804" handler:^(VLionNativeAdInformationFlowModel * _Nullable adModel, NSDictionary * _Nullable errorDic) {
}];

[[VLionManager manager] clickNativedAdWithModel:currentMdl upPoint:point downPoint:point viewController:self adBackBlock:^{
        NSLog(@"adback");
}];
信息流广告数据模型 VLionNativeAdInformationFlowModel
@property (nonatomic ,assign) int             status;//状态码
@property (nonatomic ,assign) int             adt;//创意类型
@property (nonatomic ,copy)   NSString * _Nullable      cid;//物料ID
@property (nonatomic ,strong) VLionNativeAdNativeModel* _Nullable   nativead;//原生
@property (nonatomic ,assign) int             tagid;//广告位id
@property (nonatomic ,strong) NSArray <NSString *>* _Nullable    imp_tracking;//曝光监测地址
@property (nonatomic ,strong) NSArray <NSString *>* _Nullable    clk_tracking;//点击监测地址
@property (nonatomic ,assign) int             interact_type;//点击行为0-网页,1-下载
应用墙广告数据模型 VLionNativeAdAppWallModel
@property (nonatomic ,assign) int             status;//状态码
@property (nonatomic ,assign) int             adt;//创意类型
@property (nonatomic ,copy)   NSString * _Nullable      cid;//物料ID
@property (nonatomic ,strong) VLionNativeAdNativeModel* _Nullable   nativead;//原生
@property (nonatomic ,assign) int             tagid;//广告位id
@property (nonatomic ,strong) NSArray <NSString *>* _Nullable    imp_tracking;//曝光监测地址
@property (nonatomic ,strong) NSArray <NSString *>* _Nullable    clk_tracking;//点击监测地址
@property (nonatomic ,assign) int             interact_type;//点击行为0-网页,1-下载
新闻大放送广告数据模型 VLionNativeAdNewsModel
@property (nonatomic ,assign) int             status;//状态码
@property (nonatomic ,assign) int             adt;//创意类型
@property (nonatomic ,copy)   NSString * _Nullable      cid;//物料ID
@property (nonatomic ,strong) VLionNativeAdNativeModel* _Nullable   nativead;//原生
@property (nonatomic ,assign) int             tagid;//广告位id
@property (nonatomic ,strong) NSArray <NSString *>* _Nullable    imp_tracking;//曝光监测地址
@property (nonatomic ,strong) NSArray <NSString *>* _Nullable    clk_tracking;//点击监测地址
@property (nonatomic ,assign) int             interact_type;//点击行为0-网页,1-下载
轮播图广告数据模型 VLionNativeAdShufflingModel
@property (nonatomic ,assign) int             status;//状态码
@property (nonatomic ,assign) int             adt;//创意类型
@property (nonatomic ,assign) int             tagid;//广告位id
@property (nonatomic ,copy)   NSString * _Nullable      cid;//物料ID
@property (nonatomic ,strong) NSArray <NSString *>* _Nullable    imp_tracking;//曝光监测地址
@property (nonatomic ,strong) NSArray <NSString *>* _Nullable    clk_tracking;//点击监测地址
@property (nonatomic ,strong) VLionNativeAdNativeModel* _Nullable   nativead;//原生
@property (nonatomic ,assign) int             interact_type;//点击行为0-网页,1-下载
瀑布流广告数据模型 VLionNativeAdWaterfallModel
@property (nonatomic ,assign) int             status;//状态码
@property (nonatomic ,assign) int             adt;//创意类型
@property (nonatomic ,copy)   NSString * _Nullable      cid;//物料ID
@property (nonatomic ,strong) VLionNativeAdNativeModel* _Nullable   nativead;//原生
@property (nonatomic ,assign) int             tagid;//广告位id
@property (nonatomic ,strong) NSArray <NSString *>* _Nullable    imp_tracking;//曝光监测地址
@property (nonatomic ,strong) NSArray <NSString *>* _Nullable    clk_tracking;//点击监测地址
@property (nonatomic ,assign) int             interact_type;//点击行为0-网页,1-下载
原生广告模型数据 VLionNativeAdNativeModel
@property (nonatomic ,copy)   NSString * _Nullable            ldp;//跳转url
@property (nonatomic ,strong) NSArray <VLionNativeAdIconModel *>* _Nullable            icon;//图标model
@property (nonatomic ,strong) NSArray <VLionNativeAdIconModel *> * _Nullable            img;//大图model
@property (nonatomic ,copy)   NSString * _Nullable            title;//标题名称

@property (nonatomic ,copy)   NSString * _Nullable            desc;//标题描述
@property (nonatomic ,assign) int             rating;//评定星级
@property (nonatomic ,copy)   NSString * _Nullable            button;//按钮标题
@property (nonatomic ,assign) int            download_count;//下载次数
@property (nonatomic ,copy)   NSString * _Nullable            app_download_url    ;//下载地址,和ldp二选一
原生广告图标模型 VLionNativeAdIconModel
@property (nonatomic ,copy  ) NSString * _Nullable url;
@property (nonatomic ,assign) int       w;
@property (nonatomic ,assign) int       h;