emi-indo-cordova-plugin-admob 2.2.9 → 2.3.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/.gitattributes +2 -0
- package/.github/FUNDING.yml +13 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +127 -0
- package/README.md +2 -2
- package/package.json +1 -1
- package/plugin.xml +3 -3
- package/src/android/emiAdmobPlugin.kt +1 -1
- package/src/ios/emiAdmobPlugin.h +1 -1
- package/src/ios/emiAdmobPlugin.m +132 -103
package/.gitattributes
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# These are supported funding model platforms
|
2
|
+
|
3
|
+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
4
|
+
patreon: # Replace with a single Patreon username
|
5
|
+
open_collective: # Replace with a single Open Collective username
|
6
|
+
ko_fi: emiindo
|
7
|
+
tidelift: # npm/emi-indo-cordova-plugin-admob
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
11
|
+
otechie: # Replace with a single Otechie username
|
12
|
+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
13
|
+
custom: ['paypal.me/emiindo']
|
@@ -0,0 +1,127 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
<!--
|
11
|
+
IMPORTANT: PLEASE READ
|
12
|
+
|
13
|
+
WARNING: Failure to follow the issue template guidelines below will result in the issue being immediately closed.
|
14
|
+
-->
|
15
|
+
|
16
|
+
<!-- Fill out the relevant sections below and delete irrelevant sections. -->
|
17
|
+
|
18
|
+
# Bug report
|
19
|
+
|
20
|
+
<!-- COMPLETE THIS CHECKLIST -->
|
21
|
+
|
22
|
+
|
23
|
+
- [ ] I confirm this is a suspected bug or issue that will affect other users
|
24
|
+
<!-- i.e. this is not a request for support in using/integrating the plugin into your specific project -->
|
25
|
+
|
26
|
+
- [ ] I have reproduced the issue using the [example project](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/index.html) or provided the necessary information to reproduce the issue.
|
27
|
+
<!-- necessary information e.g. exact steps, FCM notification message content, test case project repo -->
|
28
|
+
|
29
|
+
- [ ] I have read [the documentation](https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/README.md) thoroughly and it does not help solve my issue.
|
30
|
+
<!-- e.g. if you're having a build issue ensure you've read through the build environment notes -->
|
31
|
+
|
32
|
+
- [ ] I have checked that no similar issues (open or closed) already exist.
|
33
|
+
<!-- Duplicates or near-duplicates will be closed immediately. -->
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
**Current behavior:**
|
38
|
+
|
39
|
+
<!-- Describe how the bug manifests. -->
|
40
|
+
|
41
|
+
<!-- Explain how you're sure there is an issue with this plugin rather than your own code:
|
42
|
+
- If this plugin has an example project, have you been able to reproduce the issue within it?
|
43
|
+
- Have you created a clean test Cordova project containing only this plugin to eliminate the potential for interference with other plugins/code?
|
44
|
+
-->
|
45
|
+
|
46
|
+
**Expected behavior:**
|
47
|
+
<!-- Describe what the behavior should be without the bug. -->
|
48
|
+
|
49
|
+
**Steps to reproduce:**
|
50
|
+
<!-- If you are able to illustrate the bug with an example, please provide steps to reproduce. -->
|
51
|
+
|
52
|
+
**Screenshots**
|
53
|
+
<!-- If applicable, add screenshots to help explain your problem. -->
|
54
|
+
|
55
|
+
**Environment information**
|
56
|
+
<!-- Please supply full details of your development environment including: -->
|
57
|
+
- Plugin version
|
58
|
+
- `Plugin version: xxxx`
|
59
|
+
|
60
|
+
- Cordova CLI version
|
61
|
+
- `cordova -v`
|
62
|
+
- Cordova platform version
|
63
|
+
- `cordova platform ls`
|
64
|
+
- Plugins & versions installed in project (including this plugin)
|
65
|
+
- `cordova plugin ls`
|
66
|
+
- Dev machine OS and version, e.g.
|
67
|
+
- OSX
|
68
|
+
- `sw_vers`
|
69
|
+
- Windows 10
|
70
|
+
- `winver`
|
71
|
+
|
72
|
+
_Runtime issue_
|
73
|
+
- Device details
|
74
|
+
- _e.g. iPhone X, Samsung Galaxy S8, iPhone X Simulator, Pixel XL Emulator_
|
75
|
+
- OS details
|
76
|
+
- _e.g. iOS 12.2, Android 9.0_
|
77
|
+
|
78
|
+
_Android build issue:_
|
79
|
+
- Node JS version
|
80
|
+
- `node -v`
|
81
|
+
- Gradle version
|
82
|
+
- `ls platforms/android/.gradle`
|
83
|
+
- Target Android SDK version
|
84
|
+
- `android:targetSdkVersion` in `AndroidManifest.xml`
|
85
|
+
- Android SDK details
|
86
|
+
- `sdkmanager --list | sed -e '/Available Packages/q'`
|
87
|
+
|
88
|
+
_iOS build issue:_
|
89
|
+
- Node JS version
|
90
|
+
- `node -v`
|
91
|
+
- XCode version
|
92
|
+
|
93
|
+
|
94
|
+
**Related code:**
|
95
|
+
```
|
96
|
+
insert any relevant code here such as plugin API calls / input parameters
|
97
|
+
```
|
98
|
+
|
99
|
+
**Console output**
|
100
|
+
<details>
|
101
|
+
<summary>console output</summary>
|
102
|
+
|
103
|
+
```
|
104
|
+
|
105
|
+
// Paste any relevant JS/native console output here
|
106
|
+
|
107
|
+
```
|
108
|
+
|
109
|
+
</details><br/><br/>
|
110
|
+
|
111
|
+
**Other information:**
|
112
|
+
|
113
|
+
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<!--
|
120
|
+
A POLITE REMINDER
|
121
|
+
|
122
|
+
- This is free, open-source software.
|
123
|
+
- Although the author makes every effort to maintain it, no guarantees are made as to the quality or reliability, and reported issues will be addressed if and when the author has time.
|
124
|
+
- Help/support will not be given by the author, so forums (e.g. Ionic) or Stack Overflow should be used. Any issues requesting help/support will be closed immediately.
|
125
|
+
- If you have urgent need of a bug fix/feature, the author can be engaged for PAID contract work to do so: please contact dave@workingedge.co.uk
|
126
|
+
- Rude or abusive comments/issues will not be tolerated, nor will opening multiple issues if those previously closed are deemed unsuitable. Any of the above will result in you being BANNED from ALL of my Github repositories.
|
127
|
+
-->
|
package/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
### emi-indo-cordova-plugin-admob@2.
|
1
|
+
### emi-indo-cordova-plugin-admob@2.3.9
|
2
2
|
|
3
3
|
|
4
4
|
## Features/method
|
@@ -159,7 +159,7 @@ config.xml
|
|
159
159
|
### Mobile Ads SDK (Android: 24.2.0) [Release Notes:](https://developers.google.com/admob/android/rel-notes)
|
160
160
|
### User Messaging Platform (UMP Android: 3.2.0) [Release Notes:](https://developers.google.com/admob/android/privacy/release-notes)
|
161
161
|
|
162
|
-
### Mobile Ads SDK (IOS: 12.
|
162
|
+
### Mobile Ads SDK (IOS: 12.5.0) [Release Notes:](https://developers.google.com/admob/ios/rel-notes)
|
163
163
|
|
164
164
|
### User Messaging Platform (UMP IOS: 3.0.0) [Release Notes:](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/privacy/download)
|
165
165
|
### IAB Europe Transparency & Consent Framework (CMP: 2.2.0)
|
package/package.json
CHANGED
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.
|
3
|
+
id="emi-indo-cordova-plugin-admob" version="2.3.9">
|
4
4
|
|
5
5
|
<name>emiAdmobPlugin</name>
|
6
6
|
<description>Cordova/Quasar/Capacitor Plugin Admob Android IOS</description>
|
@@ -298,9 +298,9 @@
|
|
298
298
|
<source url="https://cdn.cocoapods.org/" />
|
299
299
|
</config>
|
300
300
|
<pods use-frameworks="true">
|
301
|
-
|
301
|
+
<!--minimum macOS 14.4 > Xcode 16.0 -->
|
302
302
|
<pod name="GoogleUserMessagingPlatform" spec="~> 3.0.0" />
|
303
|
-
<pod name="Google-Mobile-Ads-SDK" spec="~> 12.
|
303
|
+
<pod name="Google-Mobile-Ads-SDK" spec="~> 12.5.0" />
|
304
304
|
|
305
305
|
</pods>
|
306
306
|
</podspec>
|
@@ -262,7 +262,7 @@ class emiAdmobPlugin : CordovaPlugin() {
|
|
262
262
|
if (consentInformation!!.canRequestAds()) {
|
263
263
|
initializeMobileAdsSdk()
|
264
264
|
}
|
265
|
-
cWebView!!.loadUrl("javascript:cordova.fireDocumentEvent('on.consent.info.update.failed', {
|
265
|
+
cWebView!!.loadUrl("javascript:cordova.fireDocumentEvent('on.consent.info.update.failed', ${formError.message});")
|
266
266
|
})
|
267
267
|
}
|
268
268
|
if (consentInformation?.canRequestAds()!!) {
|
package/src/ios/emiAdmobPlugin.h
CHANGED
@@ -18,10 +18,10 @@
|
|
18
18
|
@property (nonatomic, assign) CGFloat viewWidth;
|
19
19
|
@property(nonatomic, assign) BOOL isOverlapping;
|
20
20
|
@property(nonatomic, assign) BOOL isCollapsible;
|
21
|
+
@property(nonatomic, assign) BOOL isBannerOpen;
|
21
22
|
@property (nonatomic, strong) UIView *bannerViewLayout;
|
22
23
|
@property (nonatomic, strong) UIView *bannerContainer;
|
23
24
|
@property (nonatomic, strong) UIView *webViewContainer;
|
24
|
-
|
25
25
|
@property(nonatomic, assign) BOOL isAutoShowAppOpen;
|
26
26
|
@property(nonatomic, assign) BOOL isAutoShowBanner;
|
27
27
|
@property(nonatomic, assign) BOOL isAutoShowInterstitial;
|
package/src/ios/emiAdmobPlugin.m
CHANGED
@@ -504,7 +504,9 @@ NSString *setKeyword = @"";
|
|
504
504
|
}
|
505
505
|
|
506
506
|
|
507
|
+
|
507
508
|
- (void)orientationDidChange:(NSNotification *)notification {
|
509
|
+
/*
|
508
510
|
[self fireEvent:@"" event:@"on.screen.rotated" withData:nil];
|
509
511
|
if (isAutoResize) {
|
510
512
|
dispatch_async(dispatch_get_main_queue(), ^{
|
@@ -565,6 +567,7 @@ NSString *setKeyword = @"";
|
|
565
567
|
}
|
566
568
|
});
|
567
569
|
}
|
570
|
+
*/
|
568
571
|
}
|
569
572
|
|
570
573
|
|
@@ -604,8 +607,10 @@ NSString *setKeyword = @"";
|
|
604
607
|
|
605
608
|
[self setAdRequest];
|
606
609
|
|
607
|
-
|
610
|
+
if (adFormat == 5 && !self.isBannerOpen) {
|
608
611
|
dispatch_async(dispatch_get_main_queue(), ^{
|
612
|
+
|
613
|
+
|
609
614
|
UIView *parentView = self.viewController.view;
|
610
615
|
CGRect frame = self.bannerView.frame;
|
611
616
|
|
@@ -669,7 +674,17 @@ NSString *setKeyword = @"";
|
|
669
674
|
|
670
675
|
- (void)showBannerAd:(CDVInvokedUrlCommand *)command {
|
671
676
|
@try {
|
672
|
-
|
677
|
+
|
678
|
+
if (self.bannerView && self.isBannerOpen) {
|
679
|
+
|
680
|
+
if (!self.isOverlapping){
|
681
|
+
self.bannerView.hidden = NO;
|
682
|
+
[self setBodyHeight:command];
|
683
|
+
} else {
|
684
|
+
self.bannerView.hidden = NO;
|
685
|
+
}
|
686
|
+
|
687
|
+
} else if (self.bannerView && !self.isAutoShowBanner) {
|
673
688
|
|
674
689
|
if (!self.isOverlapping){
|
675
690
|
self.bannerView.hidden = NO;
|
@@ -681,6 +696,7 @@ NSString *setKeyword = @"";
|
|
681
696
|
} else {
|
682
697
|
[self fireEvent:@"" event:@"on.banner.failed.show" withData:nil];
|
683
698
|
}
|
699
|
+
|
684
700
|
}
|
685
701
|
@catch (NSException *exception) {
|
686
702
|
NSLog(@"[AdPlugin] Error in showBannerAd: %@", exception.reason);
|
@@ -704,105 +720,109 @@ NSString *setKeyword = @"";
|
|
704
720
|
|
705
721
|
|
706
722
|
- (void)setBodyHeight:(CDVInvokedUrlCommand*)command {
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
UIWindow *keyWindow = [UIApplication sharedApplication].delegate.window;
|
711
|
-
UIViewController* rootViewController = keyWindow.rootViewController;
|
712
|
-
|
713
|
-
if (!rootViewController) {
|
714
|
-
CDVPluginResult* errorResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Root ViewController not found"];
|
715
|
-
[self.commandDelegate sendPluginResult:errorResult callbackId:command.callbackId];
|
716
|
-
return;
|
717
|
-
}
|
723
|
+
if(!self.isBannerOpen){
|
724
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
718
725
|
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
0
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
726
|
+
@try {
|
727
|
+
|
728
|
+
UIWindow *keyWindow = [UIApplication sharedApplication].delegate.window;
|
729
|
+
UIViewController* rootViewController = keyWindow.rootViewController;
|
730
|
+
|
731
|
+
if (!rootViewController) {
|
732
|
+
CDVPluginResult* errorResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Root ViewController not found"];
|
733
|
+
[self.commandDelegate sendPluginResult:errorResult callbackId:command.callbackId];
|
734
|
+
return;
|
735
|
+
}
|
736
|
+
|
737
|
+
|
738
|
+
[rootViewController.view setNeedsLayout];
|
739
|
+
[rootViewController.view layoutIfNeeded];
|
740
|
+
|
741
|
+
UIEdgeInsets safeAreaInsets = rootViewController.view.safeAreaInsets;
|
742
|
+
|
743
|
+
if (safeAreaInsets.bottom == 0) {
|
744
|
+
safeAreaInsets = keyWindow.safeAreaInsets;
|
745
|
+
}
|
746
|
+
|
747
|
+
CGFloat screenHeight = UIScreen.mainScreen.bounds.size.height;
|
748
|
+
CGFloat screenWidth = UIScreen.mainScreen.bounds.size.width;
|
749
|
+
CGFloat bannerHeight = bannerHeightFinal;
|
750
|
+
CGFloat newHeight = screenHeight - bannerHeight;
|
751
|
+
|
752
|
+
|
753
|
+
if (newHeight <= 0) {
|
754
|
+
|
755
|
+
CDVPluginResult* errorResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Invalid new height"];
|
756
|
+
[self.commandDelegate sendPluginResult:errorResult callbackId:command.callbackId];
|
757
|
+
return;
|
758
|
+
}
|
759
|
+
|
760
|
+
UIView *webView = [self findWebViewInView:rootViewController.view];
|
761
|
+
if (webView) {
|
762
|
+
CGRect webViewFrame = webView.frame;
|
763
|
+
webViewFrame.size.height = newHeight;
|
764
|
+
webView.frame = webViewFrame;
|
765
|
+
} else {
|
766
|
+
NSLog(@"[CordovaBodyHeight] WebView not found");
|
767
|
+
}
|
768
|
+
|
769
|
+
if ([setPosition isEqualToString:@"top-center"]) {
|
770
|
+
CGRect currentBannerFrame = self.bannerView.frame;
|
771
|
+
CGFloat expectedYPosition = safeAreaInsets.top;
|
772
|
+
|
773
|
+
if (fabs(currentBannerFrame.origin.y - expectedYPosition) > 0.1) {
|
774
|
+
CGRect bannerFrame = CGRectMake(0, expectedYPosition, screenWidth, bannerHeight);
|
775
|
+
self.bannerView.frame = bannerFrame;
|
776
|
+
CGRect contentFrame = rootViewController.view.frame;
|
777
|
+
contentFrame.origin.y = bannerHeight + safeAreaInsets.top;
|
778
|
+
contentFrame.size.height = screenHeight - (bannerHeight + safeAreaInsets.top);
|
779
|
+
rootViewController.view.frame = contentFrame;
|
780
|
+
}
|
781
|
+
} else if ([setPosition isEqualToString:@"bottom-center"]) {
|
782
|
+
|
783
|
+
CGRect bannerFrame = CGRectMake(
|
784
|
+
0,
|
785
|
+
screenHeight - bannerHeight - safeAreaInsets.bottom + paddingWebView,
|
786
|
+
screenWidth,
|
787
|
+
bannerHeight
|
788
|
+
);
|
789
|
+
self.bannerView.frame = bannerFrame;
|
790
|
+
|
791
|
+
CGRect contentFrame = rootViewController.view.frame;
|
792
|
+
contentFrame.origin.y = 0;
|
793
|
+
contentFrame.size.height = screenHeight - (bannerHeight + safeAreaInsets.bottom);
|
794
|
+
rootViewController.view.frame = contentFrame;
|
795
|
+
|
796
|
+
} else {
|
797
|
+
CGRect bannerFrame = CGRectMake(
|
798
|
+
0,
|
799
|
+
screenHeight - bannerHeight - safeAreaInsets.bottom + paddingWebView,
|
800
|
+
screenWidth,
|
801
|
+
bannerHeight
|
802
|
+
);
|
803
|
+
self.bannerView.frame = bannerFrame;
|
804
|
+
|
805
|
+
CGRect contentFrame = rootViewController.view.frame;
|
806
|
+
contentFrame.origin.y = 0;
|
807
|
+
contentFrame.size.height = screenHeight - (bannerHeight + safeAreaInsets.bottom);
|
808
|
+
rootViewController.view.frame = contentFrame;
|
809
|
+
|
810
|
+
}
|
793
811
|
|
794
812
|
[self.bannerView setNeedsLayout];
|
795
813
|
[self.bannerView layoutIfNeeded];
|
796
814
|
[rootViewController.view setNeedsLayout];
|
797
815
|
[rootViewController.view layoutIfNeeded];
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
816
|
+
|
817
|
+
CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:newHeight];
|
818
|
+
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
|
819
|
+
}
|
820
|
+
@catch (NSException* exception) {
|
821
|
+
NSLog(@"[CordovaBodyHeight] Exception: %@", exception.reason);
|
822
|
+
}
|
823
|
+
|
824
|
+
});
|
825
|
+
}
|
806
826
|
}
|
807
827
|
|
808
828
|
|
@@ -951,7 +971,7 @@ NSString *setKeyword = @"";
|
|
951
971
|
- (void)hideBannerAd:(CDVInvokedUrlCommand *)command {
|
952
972
|
CDVPluginResult *pluginResult;
|
953
973
|
NSString *callbackId = command.callbackId;
|
954
|
-
if (self.bannerView) {
|
974
|
+
if (self.bannerView && self.isBannerOpen) {
|
955
975
|
dispatch_async(dispatch_get_main_queue(), ^{
|
956
976
|
self.bannerView.hidden = YES;
|
957
977
|
[self resetWebViewHeight];
|
@@ -973,6 +993,7 @@ NSString *setKeyword = @"";
|
|
973
993
|
dispatch_async(dispatch_get_main_queue(), ^{
|
974
994
|
self.bannerView.hidden = YES;
|
975
995
|
[self.bannerView removeFromSuperview];
|
996
|
+
self.isBannerOpen = NO;
|
976
997
|
self.bannerView = nil;
|
977
998
|
[self resetWebViewHeight];
|
978
999
|
[self fireEvent:@"" event:@"on.banner.remove" withData:nil];
|
@@ -1688,16 +1709,19 @@ NSString *setKeyword = @"";
|
|
1688
1709
|
NSString *bannerLoadJsonString = [[NSString alloc] initWithData:bannerLoadJsonData encoding:NSUTF8StringEncoding];
|
1689
1710
|
|
1690
1711
|
[self fireEvent:@"" event:@"on.banner.load" withData:bannerLoadJsonString];
|
1712
|
+
|
1691
1713
|
|
1692
|
-
|
1693
|
-
|
1694
|
-
self.
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1714
|
+
|
1715
|
+
if (self.isAutoShowBanner && self.bannerView && !self.isBannerOpen) {
|
1716
|
+
if (!self.isOverlapping){
|
1717
|
+
self.bannerView.hidden = NO;
|
1718
|
+
[self setBodyHeight:command];
|
1719
|
+
} else {
|
1720
|
+
self.bannerView.hidden = NO;
|
1721
|
+
}
|
1699
1722
|
}
|
1700
1723
|
|
1724
|
+
|
1701
1725
|
__weak __typeof(self) weakSelf = self;
|
1702
1726
|
self.bannerView.paidEventHandler = ^(GADAdValue *_Nonnull value) {
|
1703
1727
|
__strong __typeof(weakSelf) strongSelf = weakSelf;
|
@@ -1771,18 +1795,23 @@ NSString *setKeyword = @"";
|
|
1771
1795
|
if (jsonData) {
|
1772
1796
|
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
1773
1797
|
[self fireEvent:@"" event:@"on.banner.failed.load" withData:jsonString];
|
1798
|
+
self.isBannerOpen = NO;
|
1774
1799
|
} else {
|
1775
1800
|
// Fallback in case of JSON serialization failure
|
1801
|
+
self.isBannerOpen = NO;
|
1776
1802
|
[self fireEvent:@"" event:@"on.banner.failed.load" withData:error.localizedDescription];
|
1777
1803
|
}
|
1778
1804
|
}
|
1779
1805
|
|
1780
1806
|
- (void)bannerViewDidRecordImpression:(GADBannerView *)bannerView {
|
1781
1807
|
[self fireEvent:@"" event:@"on.banner.impression" withData:nil];
|
1808
|
+
self.isBannerOpen = YES;
|
1782
1809
|
}
|
1783
1810
|
|
1784
1811
|
- (void)bannerViewWillPresentScreen:(GADBannerView *)bannerView {
|
1785
1812
|
[self fireEvent:@"" event:@"on.banner.open" withData:nil];
|
1813
|
+
self.isBannerOpen = YES;
|
1814
|
+
|
1786
1815
|
}
|
1787
1816
|
|
1788
1817
|
- (void)bannerViewWillDismissScreen:(GADBannerView *)bannerView {
|