Commit faa52201fd63d0ce4ce3d7f27b996d4602f8a40c
Merge branch 'master' of bj.gitlab.cnlive.com:ios-team/VLionADSDKDemo
# Conflicts: # VLionAdSDKDemo/VLionAdSDKDemo/New Group/ViewController.m
Showing
2 changed files
with
46 additions
and
0 deletions
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/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,6 +172,22 @@ |
| 163 | 172 | } |
| 164 | 173 | } |
| 165 | 174 | |
| 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 | +} | |
| 166 | 191 | - (void)didReceiveMemoryWarning { |
| 167 | 192 | [super didReceiveMemoryWarning]; |
| 168 | 193 | // Dispose of any resources that can be recreated. | ... | ... |