Commit 3d05d7a11f092b61393979575040c6f3cc2464ff
1 parent
f4751dd9
no message
Showing
4 changed files
with
67 additions
and
16 deletions
VLionADSDKDemo/VLionADSDKDemo.xcodeproj/project.pbxproj
| @@ -135,7 +135,7 @@ | @@ -135,7 +135,7 @@ | ||
| 135 | TargetAttributes = { | 135 | TargetAttributes = { |
| 136 | D2ED415F1F95F3BD00803E9D = { | 136 | D2ED415F1F95F3BD00803E9D = { |
| 137 | CreatedOnToolsVersion = 9.0; | 137 | CreatedOnToolsVersion = 9.0; |
| 138 | - ProvisioningStyle = Manual; | 138 | + ProvisioningStyle = Automatic; |
| 139 | }; | 139 | }; |
| 140 | }; | 140 | }; |
| 141 | }; | 141 | }; |
| @@ -316,9 +316,9 @@ | @@ -316,9 +316,9 @@ | ||
| 316 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 316 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 317 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; | 317 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; |
| 318 | CODE_SIGN_IDENTITY = "iPhone Distribution: Beijing CNLive Culture Media Inc."; | 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 | ENABLE_BITCODE = NO; | 322 | ENABLE_BITCODE = NO; |
| 323 | FRAMEWORK_SEARCH_PATHS = ( | 323 | FRAMEWORK_SEARCH_PATHS = ( |
| 324 | "$(inherited)", | 324 | "$(inherited)", |
| @@ -329,8 +329,8 @@ | @@ -329,8 +329,8 @@ | ||
| 329 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | 329 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; |
| 330 | PRODUCT_BUNDLE_IDENTIFIER = cn.vlion.VLionAdSDKDemo; | 330 | PRODUCT_BUNDLE_IDENTIFIER = cn.vlion.VLionAdSDKDemo; |
| 331 | PRODUCT_NAME = "$(TARGET_NAME)"; | 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 | TARGETED_DEVICE_FAMILY = "1,2"; | 334 | TARGETED_DEVICE_FAMILY = "1,2"; |
| 335 | }; | 335 | }; |
| 336 | name = Debug; | 336 | name = Debug; |
| @@ -341,9 +341,9 @@ | @@ -341,9 +341,9 @@ | ||
| 341 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 341 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 342 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; | 342 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; |
| 343 | CODE_SIGN_IDENTITY = "iPhone Distribution: Beijing CNLive Culture Media Inc."; | 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 | ENABLE_BITCODE = NO; | 347 | ENABLE_BITCODE = NO; |
| 348 | FRAMEWORK_SEARCH_PATHS = ( | 348 | FRAMEWORK_SEARCH_PATHS = ( |
| 349 | "$(inherited)", | 349 | "$(inherited)", |
| @@ -354,8 +354,8 @@ | @@ -354,8 +354,8 @@ | ||
| 354 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | 354 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; |
| 355 | PRODUCT_BUNDLE_IDENTIFIER = cn.vlion.VLionAdSDKDemo; | 355 | PRODUCT_BUNDLE_IDENTIFIER = cn.vlion.VLionAdSDKDemo; |
| 356 | PRODUCT_NAME = "$(TARGET_NAME)"; | 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 | TARGETED_DEVICE_FAMILY = "1,2"; | 359 | TARGETED_DEVICE_FAMILY = "1,2"; |
| 360 | }; | 360 | }; |
| 361 | name = Release; | 361 | name = Release; |
VLionADSDKDemo/VLionADSDKDemo/BannerADController.h
VLionADSDKDemo/VLionADSDKDemo/BannerADController.m
| @@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
| 38 | //配置图片类广告的填充模式 | 38 | //配置图片类广告的填充模式 |
| 39 | cfg.contentMode = UIViewContentModeScaleAspectFit; | 39 | cfg.contentMode = UIViewContentModeScaleAspectFit; |
| 40 | 40 | ||
| 41 | - [[VLionManager manager] vl_bannerWithTagId:@"446" | 41 | + [[VLionManager manager] vl_bannerWithTagId:self.tagId |
| 42 | configuration:cfg | 42 | configuration:cfg |
| 43 | superView:bannerV | 43 | superView:bannerV |
| 44 | placeholderImage:[UIImage imageNamed:@"timg.jpg"] | 44 | placeholderImage:[UIImage imageNamed:@"timg.jpg"] |
VLionADSDKDemo/VLionADSDKDemo/ViewController.m
| @@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
| 34 | logo.image = [UIImage imageNamed:@"log_max"]; | 34 | logo.image = [UIImage imageNamed:@"log_max"]; |
| 35 | [self.view addSubview:logo]; | 35 | [self.view addSubview:logo]; |
| 36 | 36 | ||
| 37 | - NSArray *titleArr = @[@"横幅广告",@"插屏广告",@"原生广告"]; | 37 | + NSArray *titleArr = @[@"横幅图片广告",@"横幅web广告",@"插屏图片广告",@"插屏web广告",@"原生广告"]; |
| 38 | 38 | ||
| 39 | for (int i = 0; i < titleArr.count; i ++) { | 39 | for (int i = 0; i < titleArr.count; i ++) { |
| 40 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; | 40 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; |
| @@ -55,13 +55,21 @@ | @@ -55,13 +55,21 @@ | ||
| 55 | - (void)adButtonAction:(UIButton *)button { | 55 | - (void)adButtonAction:(UIButton *)button { |
| 56 | 56 | ||
| 57 | switch (button.tag) { | 57 | switch (button.tag) { |
| 58 | - case 10000: {//横幅 | 58 | + case 10000: {//横幅图片 |
| 59 | BannerADController *bannerVC = [[BannerADController alloc] init]; | 59 | BannerADController *bannerVC = [[BannerADController alloc] init]; |
| 60 | + bannerVC.tagId = @"436"; | ||
| 60 | [self presentViewController:bannerVC animated:YES completion:NULL]; | 61 | [self presentViewController:bannerVC animated:YES completion:NULL]; |
| 61 | } | 62 | } |
| 62 | break; | 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 | UIView *view = [[UIView alloc] initWithFrame:self.view.bounds]; | 74 | UIView *view = [[UIView alloc] initWithFrame:self.view.bounds]; |
| 67 | view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5]; | 75 | view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5]; |
| @@ -102,7 +110,48 @@ | @@ -102,7 +110,48 @@ | ||
| 102 | } | 110 | } |
| 103 | break; | 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 | NativeAdListsController *vc = [[NativeAdListsController alloc] init]; | 155 | NativeAdListsController *vc = [[NativeAdListsController alloc] init]; |
| 107 | [self presentViewController:vc animated:YES completion:NULL]; | 156 | [self presentViewController:vc animated:YES completion:NULL]; |
| 108 | 157 |