@capacitor-community/admob 3.3.0-0 → 4.0.0-1
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/CapacitorCommunityAdmob.podspec +2 -2
- package/README.md +11 -0
- package/android/build.gradle +14 -14
- package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerAdSizeInfo.kt +1 -1
- package/ios/Plugin/Banner/BannerExecutor.swift +5 -5
- package/ios/Plugin/Interstitial/AdInterstitialExecutor.swift +5 -5
- package/ios/Plugin/Rewarded/AdRewardExecutor.swift +5 -5
- package/package.json +9 -8
|
@@ -11,9 +11,9 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
13
|
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target = '
|
|
14
|
+
s.ios.deployment_target = '13.0'
|
|
15
15
|
s.swift_version = '5.1'
|
|
16
16
|
s.static_framework = true
|
|
17
17
|
s.dependency 'Capacitor'
|
|
18
|
-
s.dependency 'Google-Mobile-Ads-SDK', '
|
|
18
|
+
s.dependency 'Google-Mobile-Ads-SDK', '9.7.0'
|
|
19
19
|
end
|
package/README.md
CHANGED
|
@@ -43,6 +43,15 @@ Made with [contributors-img](https://contrib.rocks).
|
|
|
43
43
|
|
|
44
44
|
## Installation
|
|
45
45
|
|
|
46
|
+
If you use capacitor 4:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
% npm install --save @capacitor-community/admob@next
|
|
50
|
+
% npx cap update
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
capacitor 3:
|
|
54
|
+
|
|
46
55
|
```
|
|
47
56
|
% npm install --save @capacitor-community/admob
|
|
48
57
|
% npx cap update
|
|
@@ -53,6 +62,8 @@ Made with [contributors-img](https://contrib.rocks).
|
|
|
53
62
|
In file `android/app/src/main/java/**/**/MainActivity.java`, add the plugin to the initialization list:
|
|
54
63
|
|
|
55
64
|
```java
|
|
65
|
+
import android.os.Bundle;
|
|
66
|
+
|
|
56
67
|
public class MainActivity extends BridgeActivity {
|
|
57
68
|
@Override
|
|
58
69
|
public void onCreate(Bundle savedInstanceState) {
|
package/android/build.gradle
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
ext {
|
|
2
|
-
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
ext.kotlin_version = '1.5.21'
|
|
10
10
|
repositories {
|
|
11
11
|
google()
|
|
12
|
-
|
|
12
|
+
mavenCentral()
|
|
13
13
|
}
|
|
14
14
|
dependencies {
|
|
15
|
-
classpath 'com.android.tools.build:gradle:
|
|
15
|
+
classpath 'com.android.tools.build:gradle:7.2.1'
|
|
16
16
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -21,10 +21,10 @@ apply plugin: 'com.android.library'
|
|
|
21
21
|
apply plugin: 'kotlin-android'
|
|
22
22
|
|
|
23
23
|
android {
|
|
24
|
-
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
24
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
|
|
25
25
|
defaultConfig {
|
|
26
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
27
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
26
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
27
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
|
|
28
28
|
versionCode 1
|
|
29
29
|
versionName "1.0"
|
|
30
30
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -39,15 +39,15 @@ android {
|
|
|
39
39
|
abortOnError false
|
|
40
40
|
}
|
|
41
41
|
compileOptions {
|
|
42
|
-
sourceCompatibility JavaVersion.
|
|
43
|
-
targetCompatibility JavaVersion.
|
|
42
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
43
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
repositories {
|
|
48
48
|
google()
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
mavenCentral()
|
|
50
|
+
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
def testRunner = "1.4.0"
|
|
@@ -72,7 +72,7 @@ dependencies {
|
|
|
72
72
|
// androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
73
73
|
|
|
74
74
|
// after 20.5.0, require minCompileSdk (31)
|
|
75
|
-
implementation 'com.google.android.gms:play-services-ads:
|
|
75
|
+
implementation 'com.google.android.gms:play-services-ads:21.1.0'
|
|
76
76
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
77
77
|
implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
|
|
78
78
|
implementation "androidx.core:core-ktx:1.6.0"
|
|
@@ -13,5 +13,5 @@ data class BannerAdSizeInfo(val width: Int, val height: Int) : JSObject() {
|
|
|
13
13
|
super.put("width", width)
|
|
14
14
|
super.put("height", height)
|
|
15
15
|
}
|
|
16
|
-
constructor(mAdView: AdView): this(Objects.requireNonNull(mAdView.adSize)
|
|
16
|
+
constructor(mAdView: AdView): this(Objects.requireNonNull(mAdView.adSize)!!.width, Objects.requireNonNull(mAdView.adSize)!!.height)
|
|
17
17
|
}
|
|
@@ -17,19 +17,19 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
|
|
|
17
17
|
|
|
18
18
|
switch adSize {
|
|
19
19
|
case "BANNER":
|
|
20
|
-
bannerSize =
|
|
20
|
+
bannerSize = GADAdSizeBanner
|
|
21
21
|
break
|
|
22
22
|
case "LARGE_BANNER":
|
|
23
|
-
bannerSize =
|
|
23
|
+
bannerSize = GADAdSizeLargeBanner
|
|
24
24
|
break
|
|
25
25
|
case "FULL_BANNER":
|
|
26
|
-
bannerSize =
|
|
26
|
+
bannerSize = GADAdSizeFullBanner
|
|
27
27
|
break
|
|
28
28
|
case "LEADERBOARD":
|
|
29
|
-
bannerSize =
|
|
29
|
+
bannerSize = GADAdSizeLeaderboard
|
|
30
30
|
break
|
|
31
31
|
case "MEDIUM_RECTANGLE":
|
|
32
|
-
bannerSize =
|
|
32
|
+
bannerSize = GADAdSizeMediumRectangle
|
|
33
33
|
break
|
|
34
34
|
case "SMART_BANNER":
|
|
35
35
|
bannerSize = kGADAdSizeSmartBannerPortrait
|
|
@@ -43,11 +43,6 @@ class AdInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
public func adDidPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
|
|
47
|
-
NSLog("InterstitialFullScreenDelegate Ad did present full screen content.")
|
|
48
|
-
self.plugin?.notifyListeners(InterstitialAdPluginEvents.Showed.rawValue, data: [:])
|
|
49
|
-
}
|
|
50
|
-
|
|
51
46
|
public func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
|
|
52
47
|
NSLog("InterstitialFullScreenDelegate Ad failed to present full screen content with error \(error.localizedDescription).")
|
|
53
48
|
self.plugin?.notifyListeners(InterstitialAdPluginEvents.FailedToShow.rawValue, data: [
|
|
@@ -55,6 +50,11 @@ class AdInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
55
50
|
"message": error.localizedDescription
|
|
56
51
|
])
|
|
57
52
|
}
|
|
53
|
+
|
|
54
|
+
public func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
|
|
55
|
+
NSLog("InterstitialFullScreenDelegate Ad did present full screen content.")
|
|
56
|
+
self.plugin?.notifyListeners(InterstitialAdPluginEvents.Showed.rawValue, data: [:])
|
|
57
|
+
}
|
|
58
58
|
|
|
59
59
|
public func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) {
|
|
60
60
|
NSLog("InterstitialFullScreenDelegate Ad did dismiss full screen content.")
|
|
@@ -64,11 +64,6 @@ class AdRewardExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
public func adDidPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
|
|
68
|
-
NSLog("RewardFullScreenDelegate Ad did present full screen content.")
|
|
69
|
-
self.plugin?.notifyListeners(RewardAdPluginEvents.Showed.rawValue, data: [:])
|
|
70
|
-
}
|
|
71
|
-
|
|
72
67
|
public func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
|
|
73
68
|
NSLog("RewardFullScreenDelegate Ad failed to present full screen content with error \(error.localizedDescription).")
|
|
74
69
|
self.plugin?.notifyListeners(RewardAdPluginEvents.FailedToShow.rawValue, data: [
|
|
@@ -76,6 +71,11 @@ class AdRewardExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
76
71
|
"message": error.localizedDescription
|
|
77
72
|
])
|
|
78
73
|
}
|
|
74
|
+
|
|
75
|
+
public func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
|
|
76
|
+
NSLog("RewardFullScreenDelegate Ad did present full screen content.")
|
|
77
|
+
self.plugin?.notifyListeners(RewardAdPluginEvents.Showed.rawValue, data: [:])
|
|
78
|
+
}
|
|
79
79
|
|
|
80
80
|
public func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) {
|
|
81
81
|
NSLog("RewardFullScreenDelegate Ad did dismiss full screen content.")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor-community/admob",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-1",
|
|
4
4
|
"description": "A native plugin for AdMob",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -40,10 +40,11 @@
|
|
|
40
40
|
"release": "np --no-tests"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@capacitor/android": "^
|
|
44
|
-
"@capacitor/
|
|
43
|
+
"@capacitor/android": "^4.0.0",
|
|
44
|
+
"@capacitor/core": "^4.0.0",
|
|
45
|
+
"@capacitor/cli": "^4.0.0",
|
|
45
46
|
"@capacitor/docgen": "git+https://github.com/rdlabo/capacitor-docgen.git#feat/support_extends_build",
|
|
46
|
-
"@capacitor/ios": "^
|
|
47
|
+
"@capacitor/ios": "^4.0.0",
|
|
47
48
|
"@ionic/eslint-config": "^0.3.0",
|
|
48
49
|
"@ionic/prettier-config": "^1.0.1",
|
|
49
50
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
@@ -52,15 +53,15 @@
|
|
|
52
53
|
"lint-staged": "^11.0.0",
|
|
53
54
|
"np": "^7.4.0",
|
|
54
55
|
"pre-commit": "^1.2.2",
|
|
55
|
-
"prettier": "~2.
|
|
56
|
-
"prettier-plugin-java": "~1.0.
|
|
56
|
+
"prettier": "~2.3.0",
|
|
57
|
+
"prettier-plugin-java": "~1.0.2",
|
|
57
58
|
"rimraf": "^3.0.2",
|
|
58
59
|
"rollup": "^2.32.0",
|
|
59
60
|
"swiftlint": "^1.0.1",
|
|
60
|
-
"typescript": "~4.
|
|
61
|
+
"typescript": "~4.1.5"
|
|
61
62
|
},
|
|
62
63
|
"dependencies": {
|
|
63
|
-
"@capacitor/core": "^
|
|
64
|
+
"@capacitor/core": "^4.0.0"
|
|
64
65
|
},
|
|
65
66
|
"husky": {
|
|
66
67
|
"hooks": {
|