emi-indo-cordova-plugin-admob 2.0.6 → 2.0.8
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 +201 -52
- package/example/capacitor.config.json +1 -1
- package/example/config.xml +7 -0
- package/example/package.json +1 -1
- package/example/www/css/index.css +0 -0
- package/example/www/js/bannerAd.js +9 -68
- package/example/www/js/deviceready.js +1 -1
- package/example/www/js/interstitialAd.js +0 -2
- package/example/www/js/optionalFirebaseAnalytics.js +0 -2
- package/example/www/js/rewardedAd.js +0 -2
- package/package.json +1 -1
- package/plugin.xml +7 -9
- package/src/android/emiAdmobPlugin.kt +287 -265
- package/src/ios/emiAdmobPlugin.m +24 -5
- package/www/emiAdmobPlugin.js +1 -1
- package/.gitattributes +0 -2
- package/.github/FUNDING.yml +0 -13
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -127
package/src/ios/emiAdmobPlugin.m
CHANGED
@@ -659,7 +659,25 @@ NSString *setKeyword = @"";
|
|
659
659
|
|
660
660
|
GADAdSize siz = [self __AdSizeFromString:size];
|
661
661
|
self.bannerView = [[GADBannerView alloc] initWithAdSize:siz];
|
662
|
-
|
662
|
+
|
663
|
+
|
664
|
+
CGSize bannerSize = self.bannerView.bounds.size;
|
665
|
+
CGFloat screenWidth = parentView.bounds.size.width;
|
666
|
+
CGFloat screenHeight = parentView.bounds.size.height;
|
667
|
+
|
668
|
+
// Default to top-center
|
669
|
+
CGFloat originX = (screenWidth - bannerSize.width) / 2;
|
670
|
+
CGFloat originY = 0;
|
671
|
+
|
672
|
+
if ([setPosition isEqualToString:@"bottom-center"]) {
|
673
|
+
originY = screenHeight - bannerSize.height;
|
674
|
+
} else if ([setPosition isEqualToString:@"top-center"]) {
|
675
|
+
originY = 0;
|
676
|
+
}
|
677
|
+
|
678
|
+
self.bannerView.frame = CGRectMake(originX, originY, bannerSize.width, bannerSize.height);
|
679
|
+
|
680
|
+
|
663
681
|
GADExtras *extras = [[GADExtras alloc] init];
|
664
682
|
|
665
683
|
if (isCollapsible) {
|
@@ -707,7 +725,6 @@ NSString *setKeyword = @"";
|
|
707
725
|
}
|
708
726
|
}
|
709
727
|
|
710
|
-
|
711
728
|
- (UIView*)findWebViewInView:(UIView*)view {
|
712
729
|
if ([view isKindOfClass:NSClassFromString(@"WKWebView")] || [view isKindOfClass:NSClassFromString(@"UIWebView")]) {
|
713
730
|
return view;
|
@@ -1445,7 +1462,10 @@ NSString *setKeyword = @"";
|
|
1445
1462
|
NSDictionary *options = [command.arguments objectAtIndex:0];
|
1446
1463
|
NSString *adUnitId = [options valueForKey:@"adUnitId"];
|
1447
1464
|
BOOL autoShow = [[options valueForKey:@"autoShow"] boolValue];
|
1448
|
-
auto_Show = autoShow;
|
1465
|
+
//auto_Show = autoShow;
|
1466
|
+
|
1467
|
+
__block BOOL shouldAutoShow = autoShow;
|
1468
|
+
|
1449
1469
|
adFormat = 3;
|
1450
1470
|
[self setAdRequest];
|
1451
1471
|
if (adFormat == 3) {
|
@@ -1489,7 +1509,7 @@ NSString *setKeyword = @"";
|
|
1489
1509
|
|
1490
1510
|
|
1491
1511
|
|
1492
|
-
if (
|
1512
|
+
if (shouldAutoShow) {
|
1493
1513
|
NSError *presentError = nil;
|
1494
1514
|
if ([self.rewardedAd canPresentFromRootViewController:self.viewController error:&presentError]) {
|
1495
1515
|
[self.rewardedAd presentFromRootViewController:self.viewController userDidEarnRewardHandler:^{
|
@@ -1898,4 +1918,3 @@ NSString *setKeyword = @"";
|
|
1898
1918
|
object:nil];
|
1899
1919
|
}
|
1900
1920
|
@end
|
1901
|
-
|
package/www/emiAdmobPlugin.js
CHANGED
@@ -16,7 +16,7 @@ exports.showAppOpenAd = function (success, error) {
|
|
16
16
|
exec(success, error, 'emiAdmobPlugin', 'showAppOpenAd', []);
|
17
17
|
};
|
18
18
|
exports.styleBannerAd = function (options, success, error) {
|
19
|
-
exec(success, error, 'emiAdmobPlugin', 'styleBannerAd', [options]);
|
19
|
+
exec(success, error, 'emiAdmobPlugin', 'styleBannerAd', [options]);
|
20
20
|
};
|
21
21
|
exports.loadBannerAd = function (options, success, error) {
|
22
22
|
exec(success, error, 'emiAdmobPlugin', 'loadBannerAd', [options]);
|
package/.gitattributes
DELETED
package/.github/FUNDING.yml
DELETED
@@ -1,13 +0,0 @@
|
|
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']
|
@@ -1,127 +0,0 @@
|
|
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
|
-
-->
|