Commit 3cd953cfcd0708d4f2978cdd58528fbb8ea689d4
Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/VLionADSDKDemo
Showing
4 changed files
with
68 additions
and
4 deletions
VLionADSDKDemo/VLionADSDKDemo.xcodeproj/project.pbxproj
| ... | ... | @@ -65,6 +65,14 @@ |
| 65 | 65 | /* End PBXFrameworksBuildPhase section */ |
| 66 | 66 | |
| 67 | 67 | /* Begin PBXGroup section */ |
| 68 | + D26EE1701F9D81110076873E /* New Group */ = { | |
| 69 | + isa = PBXGroup; | |
| 70 | + children = ( | |
| 71 | + D2ED41671F95F3BD00803E9D /* ViewController.m */, | |
| 72 | + ); | |
| 73 | + path = "New Group"; | |
| 74 | + sourceTree = "<group>"; | |
| 75 | + }; | |
| 68 | 76 | D2ED41571F95F3BD00803E9D = { |
| 69 | 77 | isa = PBXGroup; |
| 70 | 78 | children = ( |
| ... | ... | @@ -89,7 +97,7 @@ |
| 89 | 97 | D2ED41631F95F3BD00803E9D /* AppDelegate.h */, |
| 90 | 98 | D2ED41641F95F3BD00803E9D /* AppDelegate.m */, |
| 91 | 99 | D2ED41661F95F3BD00803E9D /* ViewController.h */, |
| 92 | - D2ED41671F95F3BD00803E9D /* ViewController.m */, | |
| 100 | + D26EE1701F9D81110076873E /* New Group */, | |
| 93 | 101 | 81DC51D11F95FB7E0060EBE3 /* BannerADController.h */, |
| 94 | 102 | 81DC51D21F95FB7E0060EBE3 /* BannerADController.m */, |
| 95 | 103 | 81DC51CF1F95FB7D0060EBE3 /* NativeAdListsController.h */, |
| ... | ... | @@ -139,7 +147,7 @@ |
| 139 | 147 | }; |
| 140 | 148 | }; |
| 141 | 149 | }; |
| 142 | - buildConfigurationList = D2ED415B1F95F3BD00803E9D /* Build configuration list for PBXProject "VLionADSDKDemo" */; | |
| 150 | + buildConfigurationList = D2ED415B1F95F3BD00803E9D /* Build configuration list for PBXProject "VLionAdSDKDemo" */; | |
| 143 | 151 | compatibilityVersion = "Xcode 8.0"; |
| 144 | 152 | developmentRegion = en; |
| 145 | 153 | hasScannedForEncodings = 0; |
| ... | ... | @@ -369,7 +377,7 @@ |
| 369 | 377 | /* End XCBuildConfiguration section */ |
| 370 | 378 | |
| 371 | 379 | /* Begin XCConfigurationList section */ |
| 372 | - D2ED415B1F95F3BD00803E9D /* Build configuration list for PBXProject "VLionADSDKDemo" */ = { | |
| 380 | + D2ED415B1F95F3BD00803E9D /* Build configuration list for PBXProject "VLionAdSDKDemo" */ = { | |
| 373 | 381 | isa = XCConfigurationList; |
| 374 | 382 | buildConfigurations = ( |
| 375 | 383 | D2ED41741F95F3BD00803E9D /* Debug */, | ... | ... |
VLionADSDKDemo/VLionADSDKDemo/BannerADController.m
| ... | ... | @@ -54,6 +54,10 @@ |
| 54 | 54 | |
| 55 | 55 | } failedBlock:^(NSDictionary * _Nonnull errorDic) { |
| 56 | 56 | |
| 57 | + NSString *errorStr = @""; | |
| 58 | + errorStr = [errorStr stringByAppendingString:[NSString stringWithFormat:@"errorCode:%@\n", errorDic[@"errorCode"]]]; | |
| 59 | + errorStr = [errorStr stringByAppendingString:[NSString stringWithFormat:@"errorMsg:%@\n", errorDic[@"errorMessage"]]]; | |
| 60 | + [self toast:errorStr]; | |
| 57 | 61 | NSLog(@"banner errorDic --------- (%@)", errorDic); |
| 58 | 62 | |
| 59 | 63 | }]; |
| ... | ... | @@ -65,6 +69,23 @@ |
| 65 | 69 | [self dismissViewControllerAnimated:YES completion:NULL]; |
| 66 | 70 | } |
| 67 | 71 | |
| 72 | +#pragma mark - | |
| 73 | +#pragma mark - toast | |
| 74 | +- (void)toast:(NSString *)message | |
| 75 | +{ | |
| 76 | + | |
| 77 | + UIAlertView *toast = [[UIAlertView alloc] initWithTitle:nil | |
| 78 | + message:message | |
| 79 | + delegate:nil | |
| 80 | + cancelButtonTitle:nil | |
| 81 | + otherButtonTitles:nil, nil]; | |
| 82 | + [toast show]; | |
| 83 | + double duration = 2.5; | |
| 84 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
| 85 | + [toast dismissWithClickedButtonIndex:0 animated:NO]; | |
| 86 | + }); | |
| 87 | +} | |
| 88 | + | |
| 68 | 89 | -(void)dealloc { |
| 69 | 90 | NSLog(@"BannerADController dealloc"); |
| 70 | 91 | } | ... | ... |
VLionADSDKDemo/VLionADSDKDemo/Info.plist
| ... | ... | @@ -4,6 +4,8 @@ |
| 4 | 4 | <dict> |
| 5 | 5 | <key>CFBundleDevelopmentRegion</key> |
| 6 | 6 | <string>$(DEVELOPMENT_LANGUAGE)</string> |
| 7 | + <key>CFBundleDisplayName</key> | |
| 8 | + <string>瑞狮广告</string> | |
| 7 | 9 | <key>CFBundleExecutable</key> |
| 8 | 10 | <string>$(EXECUTABLE_NAME)</string> |
| 9 | 11 | <key>CFBundleIdentifier</key> |
| ... | ... | @@ -16,6 +18,15 @@ |
| 16 | 18 | <string>APPL</string> |
| 17 | 19 | <key>CFBundleShortVersionString</key> |
| 18 | 20 | <string>1.0</string> |
| 21 | + <key>CFBundleURLTypes</key> | |
| 22 | + <array> | |
| 23 | + <dict> | |
| 24 | + <key>CFBundleTypeRole</key> | |
| 25 | + <string>Editor</string> | |
| 26 | + <key>CFBundleURLSchemes</key> | |
| 27 | + <array/> | |
| 28 | + </dict> | |
| 29 | + </array> | |
| 19 | 30 | <key>CFBundleVersion</key> |
| 20 | 31 | <string>1</string> |
| 21 | 32 | <key>LSRequiresIPhoneOS</key> | ... | ... |
VLionADSDKDemo/VLionADSDKDemo/ViewController.m renamed to VLionAdSDKDemo/VLionAdSDKDemo/New Group/ViewController.m
| ... | ... | @@ -100,6 +100,11 @@ |
| 100 | 100 | |
| 101 | 101 | } failedBlock:^(NSDictionary * _Nonnull errorDic) { |
| 102 | 102 | |
| 103 | + NSString *errorStr = @""; | |
| 104 | + errorStr = [errorStr stringByAppendingString:[NSString stringWithFormat:@"errorCode:%@\n", errorDic[@"errorCode"]]]; | |
| 105 | + errorStr = [errorStr stringByAppendingString:[NSString stringWithFormat:@"errorMsg:%@\n", errorDic[@"errorMessage"]]]; | |
| 106 | + [self toast:errorStr]; | |
| 107 | + | |
| 103 | 108 | NSLog(@"interstitialView -------- (%@)",errorDic); |
| 104 | 109 | |
| 105 | 110 | } closeBlock:^{ |
| ... | ... | @@ -141,6 +146,10 @@ |
| 141 | 146 | |
| 142 | 147 | } failedBlock:^(NSDictionary * _Nonnull errorDic) { |
| 143 | 148 | |
| 149 | + NSString *errorStr = @""; | |
| 150 | + errorStr = [errorStr stringByAppendingString:[NSString stringWithFormat:@"errorCode:%@\n", errorDic[@"errorCode"]]]; | |
| 151 | + errorStr = [errorStr stringByAppendingString:[NSString stringWithFormat:@"errorMsg:%@\n", errorDic[@"errorMessage"]]]; | |
| 152 | + [self toast:errorStr]; | |
| 144 | 153 | NSLog(@"interstitialView -------- (%@)",errorDic); |
| 145 | 154 | |
| 146 | 155 | } closeBlock:^{ |
| ... | ... | @@ -163,7 +172,22 @@ |
| 163 | 172 | } |
| 164 | 173 | } |
| 165 | 174 | |
| 166 | - | |
| 175 | +#pragma mark - | |
| 176 | +#pragma mark - toast | |
| 177 | +- (void)toast:(NSString *)message | |
| 178 | +{ | |
| 179 | + | |
| 180 | + UIAlertView *toast = [[UIAlertView alloc] initWithTitle:nil | |
| 181 | + message:message | |
| 182 | + delegate:nil | |
| 183 | + cancelButtonTitle:nil | |
| 184 | + otherButtonTitles:nil, nil]; | |
| 185 | + [toast show]; | |
| 186 | + double duration = 2.5; | |
| 187 | + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ | |
| 188 | + [toast dismissWithClickedButtonIndex:0 animated:NO]; | |
| 189 | + }); | |
| 190 | +} | |
| 167 | 191 | - (void)didReceiveMemoryWarning { |
| 168 | 192 | [super didReceiveMemoryWarning]; |
| 169 | 193 | // Dispose of any resources that can be recreated. | ... | ... |