Commit b671edd519878fcd5e6485e2d82ce35205c3c065

Authored by 朱林
2 parents 3d05d7a1 ce636068

Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/VLionADSDKDemo

Conflicts:
	VLionADSDKDemo/VLionADSDKDemo.xcodeproj/project.pbxproj
VLionADSDKDemo/VLionADSDKDemo/AppDelegate.m
@@ -28,12 +28,14 @@ @@ -28,12 +28,14 @@
28 configuration.skipButtonType = AdSkipButtonTypeTimeAndText; 28 configuration.skipButtonType = AdSkipButtonTypeTimeAndText;
29 configuration.frame = [UIScreen mainScreen].bounds; 29 configuration.frame = [UIScreen mainScreen].bounds;
30 30
31 - UIImage *image = [UIImage imageNamed:@""]; 31 + //开屏广告占位图建议与启动页LaunchImage相同
  32 + UIImage *image = [UIImage imageNamed:@"placeholderImage"];
32 33
33 [[VLionManager manager] vl_setupLaunchAdWithTagId:@"444" configuration:configuration keyWindow:[[UIApplication sharedApplication].delegate window] placeholderImage:image completeBlock:^(CGFloat w, CGFloat h, UIWindow * _Nonnull window) { 34 [[VLionManager manager] vl_setupLaunchAdWithTagId:@"444" configuration:configuration keyWindow:[[UIApplication sharedApplication].delegate window] placeholderImage:image completeBlock:^(CGFloat w, CGFloat h, UIWindow * _Nonnull window) {
34 35
35 NSLog(@"%f>>>>>%f>>>>>%@",w,h,window); 36 NSLog(@"%f>>>>>%f>>>>>%@",w,h,window);
36 37
  38 + // 可以根据返回的物料数据重新设置开屏广告大小
37 // window.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.width*h/w); 39 // window.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.width*h/w);
38 40
39 } successBlock:^{ 41 } successBlock:^{
VLionADSDKDemo/VLionADSDKDemo/Assets.xcassets/bg_launch_1242.imageset/bg_launch_1242.png deleted 100644 → 0

549 KB

VLionADSDKDemo/VLionADSDKDemo/Assets.xcassets/bg_launch_1242.imageset/Contents.json renamed to VLionADSDKDemo/VLionADSDKDemo/Assets.xcassets/placeholderImage.imageset/Contents.json
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 "images" : [ 2 "images" : [
3 { 3 {
4 "idiom" : "universal", 4 "idiom" : "universal",
5 - "filename" : "bg_launch_1242.png", 5 + "filename" : "bg_launch 1242_2208.png",
6 "scale" : "1x" 6 "scale" : "1x"
7 }, 7 },
8 { 8 {
VLionADSDKDemo/VLionADSDKDemo/Assets.xcassets/placeholderImage.imageset/bg_launch 1242_2208.png 0 → 100644

342 KB

VLionADSDKDemo/VLionADSDKDemo/NativeAdListsController.m
@@ -54,7 +54,12 @@ @@ -54,7 +54,12 @@
54 [[VLionManager manager] vl_nativeAdNewsWithTagId:@"" handler:^(VLionNativeAdNewsModel * _Nullable adModel, NSDictionary * _Nullable errorDic) { 54 [[VLionManager manager] vl_nativeAdNewsWithTagId:@"" handler:^(VLionNativeAdNewsModel * _Nullable adModel, NSDictionary * _Nullable errorDic) {
55 NSLog(@"model:%@",adModel); 55 NSLog(@"model:%@",adModel);
56 if (errorDic) { 56 if (errorDic) {
57 - [self toast:[NSString stringWithFormat:@"错误码:%@,%@",errorDic[@"errorCode"],errorDic[@"errorMessage"]]]; 57 + NSString *tagid = [NSString stringWithFormat:@"%d",adModel.tagid];
  58 + if(adModel.tagid == 0)
  59 + {
  60 + tagid = @"null";
  61 + }
  62 + [self toast:[NSString stringWithFormat:@"错误码:%@,%@\n请求广告位id:%@",errorDic[@"errorCode"],errorDic[@"errorMessage"],tagid]];
58 }else 63 }else
59 { 64 {
60 [self toast:[NSString stringWithFormat:@"model:%@",adModel]]; 65 [self toast:[NSString stringWithFormat:@"model:%@",adModel]];
@@ -65,7 +70,12 @@ @@ -65,7 +70,12 @@
65 [[VLionManager manager] vl_nativeAdAppWallWithTagId:@"" handler:^(VLionNativeAdAppWallModel * _Nullable adModel, NSDictionary * _Nullable errorDic) { 70 [[VLionManager manager] vl_nativeAdAppWallWithTagId:@"" handler:^(VLionNativeAdAppWallModel * _Nullable adModel, NSDictionary * _Nullable errorDic) {
66 NSLog(@"model:%@",adModel); 71 NSLog(@"model:%@",adModel);
67 if (errorDic) { 72 if (errorDic) {
68 - [self toast:[NSString stringWithFormat:@"错误码:%@,%@",errorDic[@"errorCode"],errorDic[@"errorMessage"]]]; 73 + NSString *tagid = [NSString stringWithFormat:@"%d",adModel.tagid];
  74 + if(adModel.tagid == 0)
  75 + {
  76 + tagid = @"null";
  77 + }
  78 + [self toast:[NSString stringWithFormat:@"错误码:%@,%@\n请求广告位id:%@",errorDic[@"errorCode"],errorDic[@"errorMessage"],tagid]];
69 }else 79 }else
70 { 80 {
71 [self toast:[NSString stringWithFormat:@"model:%@",adModel]]; 81 [self toast:[NSString stringWithFormat:@"model:%@",adModel]];
@@ -77,7 +87,12 @@ @@ -77,7 +87,12 @@
77 [[VLionManager manager] vl_nativeAdShufflingWithTagId:@"339" handler:^(VLionNativeAdShufflingModel * _Nullable adModel, NSDictionary * _Nullable errorDic) { 87 [[VLionManager manager] vl_nativeAdShufflingWithTagId:@"339" handler:^(VLionNativeAdShufflingModel * _Nullable adModel, NSDictionary * _Nullable errorDic) {
78 NSLog(@"model:%@",adModel); 88 NSLog(@"model:%@",adModel);
79 if (errorDic) { 89 if (errorDic) {
80 - [self toast:[NSString stringWithFormat:@"错误码:%@,%@",errorDic[@"errorCode"],errorDic[@"errorMessage"]]]; 90 + NSString *tagid = [NSString stringWithFormat:@"%d",adModel.tagid];
  91 + if(adModel.tagid == 0)
  92 + {
  93 + tagid = @"null";
  94 + }
  95 + [self toast:[NSString stringWithFormat:@"错误码:%@,%@\n请求广告位id:%@",errorDic[@"errorCode"],errorDic[@"errorMessage"],tagid]];
81 }else 96 }else
82 { 97 {
83 NSString *string = @""; 98 NSString *string = @"";
@@ -118,7 +133,12 @@ @@ -118,7 +133,12 @@
118 [[VLionManager manager] vl_nativeAdWaterfallWithTagId:@"" handler:^(VLionNativeAdWaterfallModel * _Nullable adModel, NSDictionary * _Nullable errorDic) { 133 [[VLionManager manager] vl_nativeAdWaterfallWithTagId:@"" handler:^(VLionNativeAdWaterfallModel * _Nullable adModel, NSDictionary * _Nullable errorDic) {
119 NSLog(@"model:%@",adModel); 134 NSLog(@"model:%@",adModel);
120 if (errorDic) { 135 if (errorDic) {
121 - [self toast:[NSString stringWithFormat:@"错误码:%@,%@",errorDic[@"errorCode"],errorDic[@"errorMessage"]]]; 136 + NSString *tagid = [NSString stringWithFormat:@"%d",adModel.tagid];
  137 + if(adModel.tagid == 0)
  138 + {
  139 + tagid = @"null";
  140 + }
  141 + [self toast:[NSString stringWithFormat:@"错误码:%@,%@\n请求广告位id:%@",errorDic[@"errorCode"],errorDic[@"errorMessage"],tagid]];
122 }else 142 }else
123 { 143 {
124 [self toast:[NSString stringWithFormat:@"model:%@",adModel]]; 144 [self toast:[NSString stringWithFormat:@"model:%@",adModel]];
@@ -129,7 +149,12 @@ @@ -129,7 +149,12 @@
129 case 10004: {//信息流 149 case 10004: {//信息流
130 [[VLionManager manager] vl_nativeAdInformationFlowWithTagId:@"425" handler:^(VLionNativeAdInformationFlowModel * _Nullable adModel, NSDictionary * _Nullable errorDic) { 150 [[VLionManager manager] vl_nativeAdInformationFlowWithTagId:@"425" handler:^(VLionNativeAdInformationFlowModel * _Nullable adModel, NSDictionary * _Nullable errorDic) {
131 if (errorDic) { 151 if (errorDic) {
132 - [self toast:[NSString stringWithFormat:@"错误码:%@,%@",errorDic[@"errorCode"],errorDic[@"errorMessage"]]]; 152 + NSString *tagid = [NSString stringWithFormat:@"%d",adModel.tagid];
  153 + if(adModel.tagid == 0)
  154 + {
  155 + tagid = @"null";
  156 + }
  157 + [self toast:[NSString stringWithFormat:@"错误码:%@,%@\n请求广告位id:%@",errorDic[@"errorCode"],errorDic[@"errorMessage"],tagid]];
133 }else 158 }else
134 { 159 {
135 NSString *string = @""; 160 NSString *string = @"";