Commit 3d05d7a11f092b61393979575040c6f3cc2464ff

Authored by 朱林
1 parent f4751dd9

no message

VLionADSDKDemo/VLionADSDKDemo.xcodeproj/project.pbxproj
... ... @@ -135,7 +135,7 @@
135 135 TargetAttributes = {
136 136 D2ED415F1F95F3BD00803E9D = {
137 137 CreatedOnToolsVersion = 9.0;
138   - ProvisioningStyle = Manual;
  138 + ProvisioningStyle = Automatic;
139 139 };
140 140 };
141 141 };
... ... @@ -316,9 +316,9 @@
316 316 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
317 317 ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
318 318 CODE_SIGN_IDENTITY = "iPhone Distribution: Beijing CNLive Culture Media Inc.";
319   - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Beijing CNLive Culture Media Inc.";
320   - CODE_SIGN_STYLE = Manual;
321   - DEVELOPMENT_TEAM = 59PD8HK2YG;
  319 + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
  320 + CODE_SIGN_STYLE = Automatic;
  321 + DEVELOPMENT_TEAM = 94X49GG3ZW;
322 322 ENABLE_BITCODE = NO;
323 323 FRAMEWORK_SEARCH_PATHS = (
324 324 "$(inherited)",
... ... @@ -329,8 +329,8 @@
329 329 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
330 330 PRODUCT_BUNDLE_IDENTIFIER = cn.vlion.VLionAdSDKDemo;
331 331 PRODUCT_NAME = "$(TARGET_NAME)";
332   - PROVISIONING_PROFILE = "2a0662c8-6e1d-4089-97d1-8590e09937f5";
333   - PROVISIONING_PROFILE_SPECIFIER = "VLionAd_In House";
  332 + PROVISIONING_PROFILE = "";
  333 + PROVISIONING_PROFILE_SPECIFIER = "";
334 334 TARGETED_DEVICE_FAMILY = "1,2";
335 335 };
336 336 name = Debug;
... ... @@ -341,9 +341,9 @@
341 341 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
342 342 ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
343 343 CODE_SIGN_IDENTITY = "iPhone Distribution: Beijing CNLive Culture Media Inc.";
344   - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Beijing CNLive Culture Media Inc.";
345   - CODE_SIGN_STYLE = Manual;
346   - DEVELOPMENT_TEAM = 59PD8HK2YG;
  344 + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
  345 + CODE_SIGN_STYLE = Automatic;
  346 + DEVELOPMENT_TEAM = 94X49GG3ZW;
347 347 ENABLE_BITCODE = NO;
348 348 FRAMEWORK_SEARCH_PATHS = (
349 349 "$(inherited)",
... ... @@ -354,8 +354,8 @@
354 354 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
355 355 PRODUCT_BUNDLE_IDENTIFIER = cn.vlion.VLionAdSDKDemo;
356 356 PRODUCT_NAME = "$(TARGET_NAME)";
357   - PROVISIONING_PROFILE = "2a0662c8-6e1d-4089-97d1-8590e09937f5";
358   - PROVISIONING_PROFILE_SPECIFIER = "VLionAd_In House";
  357 + PROVISIONING_PROFILE = "";
  358 + PROVISIONING_PROFILE_SPECIFIER = "";
359 359 TARGETED_DEVICE_FAMILY = "1,2";
360 360 };
361 361 name = Release;
... ...
VLionADSDKDemo/VLionADSDKDemo/BannerADController.h
... ... @@ -10,4 +10,6 @@
10 10  
11 11 @interface BannerADController : UIViewController
12 12  
  13 +@property (nonatomic, strong) NSString *tagId;
  14 +
13 15 @end
... ...
VLionADSDKDemo/VLionADSDKDemo/BannerADController.m
... ... @@ -38,7 +38,7 @@
38 38 //配置图片类广告的填充模式
39 39 cfg.contentMode = UIViewContentModeScaleAspectFit;
40 40  
41   - [[VLionManager manager] vl_bannerWithTagId:@"446"
  41 + [[VLionManager manager] vl_bannerWithTagId:self.tagId
42 42 configuration:cfg
43 43 superView:bannerV
44 44 placeholderImage:[UIImage imageNamed:@"timg.jpg"]
... ...
VLionADSDKDemo/VLionADSDKDemo/ViewController.m
... ... @@ -34,7 +34,7 @@
34 34 logo.image = [UIImage imageNamed:@"log_max"];
35 35 [self.view addSubview:logo];
36 36  
37   - NSArray *titleArr = @[@"横幅广告",@"插屏广告",@"原生广告"];
  37 + NSArray *titleArr = @[@"横幅图片广告",@"横幅web广告",@"插屏图片广告",@"插屏web广告",@"原生广告"];
38 38  
39 39 for (int i = 0; i < titleArr.count; i ++) {
40 40 UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
... ... @@ -55,13 +55,21 @@
55 55 - (void)adButtonAction:(UIButton *)button {
56 56  
57 57 switch (button.tag) {
58   - case 10000: {//横幅
  58 + case 10000: {//横幅图片
59 59 BannerADController *bannerVC = [[BannerADController alloc] init];
  60 + bannerVC.tagId = @"436";
60 61 [self presentViewController:bannerVC animated:YES completion:NULL];
61 62 }
62 63 break;
63 64  
64   - case 10001: {//插屏
  65 + case 10001: {//横幅web
  66 + BannerADController *bannerVC = [[BannerADController alloc] init];
  67 + bannerVC.tagId = @"418";
  68 + [self presentViewController:bannerVC animated:YES completion:NULL];
  69 + }
  70 + break;
  71 +
  72 + case 10002: {//插屏图片
65 73  
66 74 UIView *view = [[UIView alloc] initWithFrame:self.view.bounds];
67 75 view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
... ... @@ -102,7 +110,48 @@
102 110 }
103 111 break;
104 112  
105   - case 10002: {//原生
  113 + case 10003: {//插屏web
  114 +
  115 + UIView *view = [[UIView alloc] initWithFrame:self.view.bounds];
  116 + view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
  117 +
  118 + //创建插屏广告容器
  119 + interstitialV = [[UIView alloc] init];
  120 +
  121 + UIWindow *window = [[UIApplication sharedApplication].delegate window];
  122 +
  123 + VLionAdConfiguration *cfg = [VLionAdConfiguration defaultConfiguration];
  124 + //设置图片类广告的填充模式
  125 + cfg.contentMode = UIViewContentModeScaleAspectFit;
  126 +
  127 + [[VLionManager manager] vl_interstitialWithTagId:@"414"
  128 + configuration:cfg
  129 + superView:interstitialV
  130 + placeholderImage:[UIImage imageNamed:@"timg.jpg"]
  131 + viewController:self
  132 + completeBlock:^(UIView * _Nonnull interstitialView, float w, float h, float closeBtnH) {
  133 +
  134 + interstitialView.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width-60, ([UIScreen mainScreen].bounds.size.width-60)*h/w + closeBtnH);
  135 + interstitialV.center = window.center;
  136 +
  137 + } successBlock:^{
  138 +
  139 + [view addSubview:interstitialV];
  140 + [window addSubview:view];
  141 +
  142 + } failedBlock:^(NSDictionary * _Nonnull errorDic) {
  143 +
  144 + NSLog(@"interstitialView -------- (%@)",errorDic);
  145 +
  146 + } closeBlock:^{
  147 + [[VLionManager manager] vl_destroyBannerOrInterstitialAdvertisement:interstitialV];
  148 + [view removeFromSuperview];
  149 +
  150 + }];
  151 + }
  152 + break;
  153 +
  154 + case 10004: {//原生
106 155 NativeAdListsController *vc = [[NativeAdListsController alloc] init];
107 156 [self presentViewController:vc animated:YES completion:NULL];
108 157  
... ...