emi-indo-cordova-plugin-admob 2.1.9 → 2.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ### emi-indo-cordova-plugin-admob@2.1.9
1
+ ### emi-indo-cordova-plugin-admob@2.2.9
2
2
 
3
3
 
4
4
  ## Features/method
@@ -14,7 +14,7 @@
14
14
  "author": "Apache Cordova Team",
15
15
  "license": "Apache-2.0",
16
16
  "devDependencies": {
17
- "emi-indo-cordova-plugin-admob": "^2.0.8"
17
+ "emi-indo-cordova-plugin-admob": "^2.2.9"
18
18
  },
19
19
  "cordova": {
20
20
  "plugins": {
@@ -8,16 +8,6 @@
8
8
 
9
9
  function loadBanner() {
10
10
 
11
- // Optional Only IOS
12
- if (isPlatformIOS){
13
- cordova.plugins.emiAdmobPlugin.styleBannerAd({
14
- isOverlapping: true, // default false
15
- paddingWebView: 1.0
16
- });
17
-
18
- }
19
-
20
-
21
11
  // default: Android | IOS
22
12
  cordova.plugins.emiAdmobPlugin.loadBannerAd({
23
13
  adUnitId: Banner_ID, //Banner_ID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emi-indo-cordova-plugin-admob",
3
- "version": "2.1.9",
3
+ "version": "2.2.9",
4
4
  "description": "Cordova/Quasar/Capacitor Plugin Admob Android IOS",
5
5
  "cordova": {
6
6
  "id": "emi-indo-cordova-plugin-admob",
package/plugin.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
2
2
  xmlns:android="http://schemas.android.com/apk/res/android"
3
- id="emi-indo-cordova-plugin-admob" version="2.1.9">
3
+ id="emi-indo-cordova-plugin-admob" version="2.2.9">
4
4
 
5
5
  <name>emiAdmobPlugin</name>
6
6
  <description>Cordova/Quasar/Capacitor Plugin Admob Android IOS</description>
@@ -16,10 +16,18 @@
16
16
  @property(nonatomic, readonly) BOOL canRequestAds;
17
17
  @property (nonatomic, assign) BOOL isUsingAdManagerRequest;
18
18
  @property (nonatomic, assign) CGFloat viewWidth;
19
+ @property(nonatomic, assign) BOOL isOverlapping;
20
+ @property(nonatomic, assign) BOOL isCollapsible;
19
21
  @property (nonatomic, strong) UIView *bannerViewLayout;
20
22
  @property (nonatomic, strong) UIView *bannerContainer;
21
23
  @property (nonatomic, strong) UIView *webViewContainer;
22
24
 
25
+ @property(nonatomic, assign) BOOL isAutoShowAppOpen;
26
+ @property(nonatomic, assign) BOOL isAutoShowBanner;
27
+ @property(nonatomic, assign) BOOL isAutoShowInterstitial;
28
+ @property(nonatomic, assign) BOOL isAutoShowRewardedAds;
29
+ @property(nonatomic, assign) BOOL isAutoShowRewardedInt;
30
+
23
31
  - (void)initialize:(CDVInvokedUrlCommand *)command;
24
32
  - (void)requestIDFA:(CDVInvokedUrlCommand *)command;
25
33
  - (void)showPrivacyOptionsForm:(CDVInvokedUrlCommand *)command;
@@ -7,6 +7,7 @@
7
7
  #import <Cordova/CDVViewController.h>
8
8
 
9
9
  @implementation emiAdmobPlugin
10
+
10
11
  @synthesize appOpenAd;
11
12
  @synthesize bannerView;
12
13
  @synthesize interstitial;
@@ -15,25 +16,20 @@
15
16
  @synthesize command;
16
17
  @synthesize responseInfo;
17
18
  @synthesize isPrivacyOptionsRequired;
19
+
18
20
  int attStatus = 0;
19
- // int fromStatus = 0; // Deprecated
21
+
20
22
  int Consent_Status = 0;
21
23
  int adFormat = 0;
22
24
  int adWidth = 320; // Default
23
25
 
24
- BOOL auto_Show = NO;
25
26
  // NSString *Npa = @"1"; // Deprecated
26
27
  NSString *setPosition = @"bottom-center"; // Default
27
28
  NSString *bannerSaveAdUnitId = @""; // autoResize dependency = true
28
29
 
29
-
30
-
31
- BOOL isCollapsible = NO;
32
30
  BOOL isAutoResize = NO;
33
31
 
34
-
35
32
  CGFloat paddingWebView = 0; // Default
36
- BOOL isSetOverlapping = NO; // Default
37
33
  CGFloat bannerHeightFinal = 50; // Default
38
34
 
39
35
  int isAdSkip = 0;
@@ -60,10 +56,10 @@ NSString *setKeyword = @"";
60
56
  - (void)setAdRequest {
61
57
  if (isUsingAdManagerRequest) {
62
58
  self.globalRequest = [GAMRequest request];
63
- NSLog(@"Using AdManager request");
59
+ // NSLog(@"Using AdManager request");
64
60
  } else {
65
61
  self.globalRequest = [GADRequest request];
66
- NSLog(@"Using AdMob request");
62
+ // NSLog(@"Using AdMob request");
67
63
  }
68
64
 
69
65
  if (isEnabledKeyword && setKeyword.length > 0) {
@@ -71,7 +67,7 @@ NSString *setKeyword = @"";
71
67
  for (NSString *keyword in keywords) {
72
68
  NSString *trimmedKeyword = [keyword stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
73
69
  if (trimmedKeyword.length > 0) {
74
- NSLog(@"Adding keyword: %@", trimmedKeyword);
70
+ // NSLog(@"Adding keyword: %@", trimmedKeyword);
75
71
  [self.globalRequest setKeywords:[self.globalRequest.keywords arrayByAddingObject:trimmedKeyword]];
76
72
  }
77
73
  }
@@ -81,17 +77,9 @@ NSString *setKeyword = @"";
81
77
 
82
78
 
83
79
 
80
+ - (void)isResponseInfo:(BOOL)value { isResponseInfo = value; }
81
+ - (void)isDebugGeography:(BOOL)value { isDebugGeography = value; }
84
82
 
85
-
86
-
87
-
88
-
89
- - (void)isResponseInfo:(BOOL)value {
90
- isResponseInfo = value;
91
- }
92
- - (void)isDebugGeography:(BOOL)value {
93
- isDebugGeography = value;
94
- }
95
83
  - (void)initialize:(CDVInvokedUrlCommand *)command {
96
84
 
97
85
  NSDictionary *options = [command.arguments objectAtIndex:0];
@@ -154,11 +142,11 @@ NSString *setKeyword = @"";
154
142
  [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
155
143
  }];
156
144
  }
157
-
158
145
 
159
146
  if (UMPConsentInformation.sharedInstance.canRequestAds) {
160
147
  [self startGoogleMobileAdsSDK];
161
148
  }
149
+
162
150
  }];
163
151
  } else if (status == UMPConsentStatusNotRequired || status == UMPConsentStatusObtained) {
164
152
  if (UMPConsentInformation.sharedInstance.canRequestAds) {
@@ -183,8 +171,6 @@ NSString *setKeyword = @"";
183
171
 
184
172
  if (@available(iOS 14, *)) {
185
173
  dispatch_async(dispatch_get_main_queue(), ^{
186
- // Added a 1-second pause before performing a tracking authorization request
187
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
188
174
 
189
175
  [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
190
176
  if (status == ATTrackingManagerAuthorizationStatusDenied) {
@@ -200,7 +186,6 @@ NSString *setKeyword = @"";
200
186
  pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:attStatus];
201
187
  [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
202
188
  }];
203
- });
204
189
  });
205
190
  } else {
206
191
  [self fireEvent:@"" event:@"on.getIDFA.error" withData:nil];
@@ -254,26 +239,15 @@ NSString *setKeyword = @"";
254
239
  result[@"TCString"] = TCString;
255
240
  result[@"additionalConsent"] = additionalConsent;
256
241
 
257
- // NSLog(@"Result dictionary: %@", result);consentStatus
258
-
259
242
  NSError *error;
260
- NSData *jsonData = [NSJSONSerialization dataWithJSONObject:result
261
- options:0
262
- error:&error];
243
+ NSData *jsonData = [NSJSONSerialization dataWithJSONObject:result options:0 error:&error];
263
244
 
264
245
  if (!jsonData) {
265
- NSLog(@"Error converting result to JSON: %@",
266
- error.localizedDescription);
246
+ NSLog(@"Error converting result to JSON: %@", error.localizedDescription);
267
247
  } else {
268
- NSString *jsonString =
269
- [[NSString alloc] initWithData:jsonData
270
- encoding:NSUTF8StringEncoding];
271
-
272
- // NSLog(@"JSON String: %@", jsonString);
273
-
248
+ NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
274
249
  [self fireEvent:@"" event:@"on.sdkInitialization" withData:jsonString];
275
250
  }
276
-
277
251
  [prefs synchronize];
278
252
  }];
279
253
  });
@@ -316,6 +290,8 @@ NSString *setKeyword = @"";
316
290
  });
317
291
  }
318
292
 
293
+
294
+
319
295
  - (void)showPrivacyOptionsForm:(CDVInvokedUrlCommand *)command {
320
296
  NSString *deviceId = [self __getAdMobDeviceId];
321
297
  UMPRequestParameters *parameters = [[UMPRequestParameters alloc] init];
@@ -370,10 +346,6 @@ NSString *setKeyword = @"";
370
346
 
371
347
 
372
348
 
373
-
374
-
375
-
376
-
377
349
  - (BOOL)isPrivacyOptionsRequired {
378
350
  UMPPrivacyOptionsRequirementStatus status = UMPConsentInformation.sharedInstance.privacyOptionsRequirementStatus;
379
351
 
@@ -399,10 +371,8 @@ NSString *setKeyword = @"";
399
371
  }
400
372
 
401
373
  CDVPluginResult *pluginResult =
402
- [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
403
- messageAsInt:Consent_Status];
404
- [self.commandDelegate sendPluginResult:pluginResult
405
- callbackId:command.callbackId];
374
+ [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:Consent_Status];
375
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
406
376
  }];
407
377
  }
408
378
 
@@ -462,8 +432,7 @@ NSString *setKeyword = @"";
462
432
  setPublisherFirstPartyIDEnabled:pubIdEnabled];
463
433
  pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
464
434
  } @catch (NSException *exception) {
465
- pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR
466
- messageAsString:exception.reason];
435
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:exception.reason];
467
436
  }
468
437
  [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
469
438
  }
@@ -531,14 +500,11 @@ NSString *setKeyword = @"";
531
500
  result[@"IABTCF_PurposeConsents"] = PurposeConsents;
532
501
  result[@"IABTCF_TCString"] = TCString;
533
502
 
534
- // NSLog(@"%@", [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]);
535
-
536
503
  [prefs synchronize];
537
504
  }
538
505
 
539
506
 
540
507
  - (void)orientationDidChange:(NSNotification *)notification {
541
- // NSLog(@"Orientation changed");
542
508
  [self fireEvent:@"" event:@"on.screen.rotated" withData:nil];
543
509
  if (isAutoResize) {
544
510
  dispatch_async(dispatch_get_main_queue(), ^{
@@ -584,19 +550,16 @@ NSString *setKeyword = @"";
584
550
 
585
551
  [self.bannerViewLayout addSubview:self.bannerView];
586
552
  [self.bannerViewLayout bringSubviewToFront:self.bannerView];
587
-
588
- if (isSetOverlapping) {
589
-
590
- if (auto_Show && self.bannerView) {
591
- if (isSetOverlapping){
553
+
554
+ if (self.isAutoShowBanner && self.bannerView) {
555
+ if (!self.isOverlapping){
592
556
  self.bannerView.hidden = NO;
593
557
  [self setBodyHeight:self.command];
594
- }
558
+ } else {
559
+ self.bannerView.hidden = NO;
560
+ }
595
561
  }
596
562
 
597
-
598
- }
599
-
600
563
  } @catch (NSException *exception) {
601
564
  NSLog(@"Exception: %@", exception.reason);
602
565
  }
@@ -615,12 +578,11 @@ NSString *setKeyword = @"";
615
578
  NSString *collapsible = [options valueForKey:@"collapsible"];
616
579
  BOOL autoResize = [[options valueForKey:@"autoResize"] boolValue];
617
580
  NSString *size = [options valueForKey:@"size"];
618
- BOOL autoShow = [[options valueForKey:@"autoShow"] boolValue];
581
+ self.isAutoShowBanner = [[options valueForKey:@"autoShow"] boolValue];
582
+ self.isOverlapping = [[options valueForKey:@"isOverlapping"] boolValue];
619
583
 
620
584
  bannerSaveAdUnitId = adUnitId;
621
-
622
585
  setPosition = position;
623
-
624
586
  adFormat = 5;
625
587
 
626
588
  if (adUnitId == nil || [adUnitId length] == 0) {
@@ -630,10 +592,10 @@ NSString *setKeyword = @"";
630
592
  return;
631
593
  }
632
594
 
633
- if (collapsible != nil && [collapsible length] > 0) {
634
- isCollapsible = YES;
595
+ if (collapsible != nil && [collapsible length] > 0) {
596
+ self.isCollapsible = YES;
635
597
  } else {
636
- isCollapsible = NO;
598
+ self.isCollapsible = NO;
637
599
  }
638
600
 
639
601
  if (autoResize) {
@@ -653,19 +615,16 @@ NSString *setKeyword = @"";
653
615
  }
654
616
 
655
617
  self.viewWidth = frame.size.width;
656
-
657
- auto_Show = autoShow;
618
+
658
619
  adWidth = self.viewWidth;
659
620
 
660
621
  GADAdSize siz = [self __AdSizeFromString:size];
661
622
  self.bannerView = [[GADBannerView alloc] initWithAdSize:siz];
662
623
 
663
-
664
624
  CGSize bannerSize = self.bannerView.bounds.size;
665
625
  CGFloat screenWidth = parentView.bounds.size.width;
666
626
  CGFloat screenHeight = parentView.bounds.size.height;
667
627
 
668
- // Default to top-center
669
628
  CGFloat originX = (screenWidth - bannerSize.width) / 2;
670
629
  CGFloat originY = 0;
671
630
 
@@ -680,9 +639,9 @@ NSString *setKeyword = @"";
680
639
 
681
640
  GADExtras *extras = [[GADExtras alloc] init];
682
641
 
683
- if (isCollapsible) {
642
+ if (self.isCollapsible) {
684
643
  extras.additionalParameters = @{@"collapsible" : collapsible};
685
-
644
+
686
645
  [self.globalRequest registerAdNetworkExtras:extras];
687
646
 
688
647
  }
@@ -700,7 +659,7 @@ NSString *setKeyword = @"";
700
659
 
701
660
  pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
702
661
  } else {
703
- // NSLog(@"Admob Option invalid for banner");
662
+
704
663
  pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
705
664
  }
706
665
 
@@ -711,11 +670,14 @@ NSString *setKeyword = @"";
711
670
  - (void)showBannerAd:(CDVInvokedUrlCommand *)command {
712
671
  @try {
713
672
  if (self.bannerView) {
714
- self.bannerView.hidden = NO;
715
- if (isSetOverlapping){
673
+
674
+ if (!self.isOverlapping){
675
+ self.bannerView.hidden = NO;
716
676
  [self setBodyHeight:command];
677
+ } else {
678
+ self.bannerView.hidden = NO;
717
679
  }
718
-
680
+
719
681
  } else {
720
682
  [self fireEvent:@"" event:@"on.banner.failed.show" withData:nil];
721
683
  }
@@ -828,7 +790,7 @@ NSString *setKeyword = @"";
828
790
  rootViewController.view.frame = contentFrame;
829
791
 
830
792
  }
831
-
793
+
832
794
  [self.bannerView setNeedsLayout];
833
795
  [self.bannerView layoutIfNeeded];
834
796
  [rootViewController.view setNeedsLayout];
@@ -860,10 +822,9 @@ NSString *setKeyword = @"";
860
822
 
861
823
  - (void)styleBannerAd:(CDVInvokedUrlCommand *)command {
862
824
  NSDictionary *options = [command.arguments objectAtIndex:0];
863
- BOOL isOverlapping = [[options valueForKey:@"isOverlapping"] boolValue];
825
+ self.isOverlapping = [[options valueForKey:@"isOverlapping"] boolValue];
864
826
  CGFloat paddingContainer = [[options valueForKey:@"paddingWebView"] floatValue];
865
827
 
866
- isSetOverlapping = isOverlapping;
867
828
  paddingWebView = paddingContainer;
868
829
 
869
830
  dispatch_async(dispatch_get_main_queue(), ^{
@@ -1022,15 +983,16 @@ NSString *setKeyword = @"";
1022
983
  }
1023
984
  [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
1024
985
  }
986
+
987
+
1025
988
  - (void)loadAppOpenAd:(CDVInvokedUrlCommand *)command {
1026
989
  CDVPluginResult *pluginResult;
1027
990
  NSString *callbackId = command.callbackId;
1028
991
 
1029
992
  NSDictionary *options = [command.arguments objectAtIndex:0];
1030
993
  NSString *adUnitId = [options valueForKey:@"adUnitId"];
1031
- BOOL autoShow = [[options valueForKey:@"autoShow"] boolValue];
994
+ self.isAutoShowAppOpen = [[options valueForKey:@"autoShow"] boolValue];
1032
995
 
1033
- auto_Show = autoShow;
1034
996
  adFormat = 1;
1035
997
  self.appOpenAd = nil;
1036
998
 
@@ -1084,7 +1046,7 @@ NSString *setKeyword = @"";
1084
1046
  };
1085
1047
 
1086
1048
 
1087
- if (auto_Show) {
1049
+ if (self.isAutoShowAppOpen) {
1088
1050
  NSError *presentError = nil;
1089
1051
  if ([self.appOpenAd canPresentFromRootViewController:self.viewController error:&presentError]) {
1090
1052
  [self.appOpenAd presentFromRootViewController:self.viewController];
@@ -1146,9 +1108,7 @@ NSString *setKeyword = @"";
1146
1108
  - (void)showAppOpenAd:(CDVInvokedUrlCommand *)command {
1147
1109
  CDVPluginResult *pluginResult;
1148
1110
  NSString *callbackId = command.callbackId;
1149
- if (self.appOpenAd &&
1150
- [self.appOpenAd canPresentFromRootViewController:self.viewController
1151
- error:nil]) {
1111
+ if (self.appOpenAd && [self.appOpenAd canPresentFromRootViewController:self.viewController error:nil]) {
1152
1112
  [self.appOpenAd presentFromRootViewController:self.viewController];
1153
1113
  adFormat = 1;
1154
1114
  pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
@@ -1158,15 +1118,16 @@ NSString *setKeyword = @"";
1158
1118
  }
1159
1119
  [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
1160
1120
  }
1121
+
1122
+
1161
1123
  - (void)loadInterstitialAd:(CDVInvokedUrlCommand *)command {
1162
1124
  CDVPluginResult *pluginResult;
1163
1125
  NSString *callbackId = command.callbackId;
1164
1126
 
1165
1127
  NSDictionary *options = [command.arguments objectAtIndex:0];
1166
1128
  NSString *adUnitId = [options valueForKey:@"adUnitId"];
1167
- BOOL autoShow = [[options valueForKey:@"autoShow"] boolValue];
1129
+ self.isAutoShowInterstitial = [[options valueForKey:@"autoShow"] boolValue];
1168
1130
 
1169
- auto_Show = autoShow;
1170
1131
  adFormat = 2;
1171
1132
  [self setAdRequest];
1172
1133
  if (adFormat == 2) {
@@ -1213,7 +1174,7 @@ NSString *setKeyword = @"";
1213
1174
  };
1214
1175
 
1215
1176
 
1216
- if (auto_Show) {
1177
+ if (self.isAutoShowInterstitial) {
1217
1178
  NSError *presentError = nil;
1218
1179
  if ([self.interstitial canPresentFromRootViewController:self.viewController error:&presentError]) {
1219
1180
  [self.interstitial presentFromRootViewController:self.viewController];
@@ -1300,9 +1261,8 @@ NSString *setKeyword = @"";
1300
1261
 
1301
1262
  NSDictionary *options = [command.arguments objectAtIndex:0];
1302
1263
  NSString *adUnitId = [options valueForKey:@"adUnitId"];
1303
- BOOL autoShow = [[options valueForKey:@"autoShow"] boolValue];
1264
+ self.isAutoShowRewardedInt = [[options valueForKey:@"autoShow"] boolValue];
1304
1265
 
1305
- auto_Show = autoShow;
1306
1266
  adFormat = 4;
1307
1267
  [self setAdRequest];
1308
1268
  if (adFormat == 4) {
@@ -1348,7 +1308,7 @@ NSString *setKeyword = @"";
1348
1308
  };
1349
1309
 
1350
1310
 
1351
- if (auto_Show) {
1311
+ if (self.isAutoShowRewardedInt) {
1352
1312
  NSError *presentError = nil;
1353
1313
  if ([self.rewardedInterstitialAd canPresentFromRootViewController:self.viewController error:&presentError]) {
1354
1314
  [self.rewardedInterstitialAd presentFromRootViewController:self.viewController userDidEarnRewardHandler:^{
@@ -1461,10 +1421,7 @@ NSString *setKeyword = @"";
1461
1421
  NSString *callbackId = command.callbackId;
1462
1422
  NSDictionary *options = [command.arguments objectAtIndex:0];
1463
1423
  NSString *adUnitId = [options valueForKey:@"adUnitId"];
1464
- BOOL autoShow = [[options valueForKey:@"autoShow"] boolValue];
1465
- //auto_Show = autoShow;
1466
-
1467
- __block BOOL shouldAutoShow = autoShow;
1424
+ self.isAutoShowRewardedAds = [[options valueForKey:@"autoShow"] boolValue];
1468
1425
 
1469
1426
  adFormat = 3;
1470
1427
  [self setAdRequest];
@@ -1509,7 +1466,7 @@ NSString *setKeyword = @"";
1509
1466
 
1510
1467
 
1511
1468
 
1512
- if (shouldAutoShow) {
1469
+ if (self.isAutoShowRewardedAds) {
1513
1470
  NSError *presentError = nil;
1514
1471
  if ([self.rewardedAd canPresentFromRootViewController:self.viewController error:&presentError]) {
1515
1472
  [self.rewardedAd presentFromRootViewController:self.viewController userDidEarnRewardHandler:^{
@@ -1712,7 +1669,7 @@ NSString *setKeyword = @"";
1712
1669
  #pragma mark GADBannerViewDelegate implementation
1713
1670
 
1714
1671
  - (void)bannerViewDidReceiveAd:(GADBannerView *)bannerView {
1715
- // NSLog(@"The last loaded banner is %@collapsible.", (bannerView.isCollapsible ? @"" : @"not "));
1672
+
1716
1673
  NSString *collapsibleStatus = bannerView.isCollapsible ? @"collapsible" : @"not collapsible";
1717
1674
  NSDictionary *eventData = @{@"collapsible" : collapsibleStatus};
1718
1675
  NSError *error;
@@ -1723,29 +1680,24 @@ NSString *setKeyword = @"";
1723
1680
  [self fireEvent:@"" event:@"on.is.collapsible" withData:jsonString];
1724
1681
  }
1725
1682
 
1726
- // Get the banner height
1727
1683
  CGFloat bannerHeight = bannerView.bounds.size.height;
1728
1684
  bannerHeightFinal = bannerHeight;
1729
1685
 
1730
-
1731
- // Prepare height data for banner load event
1732
1686
  NSDictionary *bannerLoadData = @{@"height" : @(bannerHeight)};
1733
1687
  NSData *bannerLoadJsonData = [NSJSONSerialization dataWithJSONObject:bannerLoadData options:0 error:&error];
1734
1688
  NSString *bannerLoadJsonString = [[NSString alloc] initWithData:bannerLoadJsonData encoding:NSUTF8StringEncoding];
1735
1689
 
1736
- // Fire the banner load event with the height data
1737
1690
  [self fireEvent:@"" event:@"on.banner.load" withData:bannerLoadJsonString];
1738
1691
 
1739
- if (auto_Show && self.bannerView) {
1740
- if (isSetOverlapping){
1692
+ if (self.isAutoShowBanner && self.bannerView) {
1693
+ if (!self.isOverlapping){
1741
1694
  self.bannerView.hidden = NO;
1742
1695
  [self setBodyHeight:command];
1743
- }
1744
- } else {
1745
- [self fireEvent:@"" event:@"on.banner.failed.show" withData:nil];
1696
+ } else {
1697
+ self.bannerView.hidden = NO;
1698
+ }
1746
1699
  }
1747
1700
 
1748
-
1749
1701
  __weak __typeof(self) weakSelf = self;
1750
1702
  self.bannerView.paidEventHandler = ^(GADAdValue *_Nonnull value) {
1751
1703
  __strong __typeof(weakSelf) strongSelf = weakSelf;