cordova-admob-tomitank 1.3.5 → 1.3.6
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/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/android/cordova/AdMob.java +25 -21
- package/src/ios/AMBPlugin.swift +23 -18
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
|
-
<plugin id="cordova-admob-tomitank" version="1.3.
|
|
2
|
+
<plugin id="cordova-admob-tomitank" version="1.3.6"
|
|
3
3
|
xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
4
4
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
5
5
|
<name>cordova-admob-tomitank</name>
|
|
@@ -31,7 +31,6 @@ import admob.plus.core.Ad;
|
|
|
31
31
|
|
|
32
32
|
import static admob.plus.core.Helper.ads;
|
|
33
33
|
|
|
34
|
-
|
|
35
34
|
public class AdMob extends CordovaPlugin implements Helper.Adapter {
|
|
36
35
|
public static final String NATIVE_VIEW_DEFAULT = Native.VIEW_DEFAULT_KEY;
|
|
37
36
|
private static final String TAG = "AdMobPlus";
|
|
@@ -74,29 +73,34 @@ public class AdMob extends CordovaPlugin implements Helper.Adapter {
|
|
|
74
73
|
break;
|
|
75
74
|
case Actions.AD_CREATE:
|
|
76
75
|
String adClass = ctx.optString("cls");
|
|
77
|
-
if (adClass == null) {
|
|
76
|
+
if (adClass == null) { // class missing..
|
|
78
77
|
ctx.reject("ad cls is missing");
|
|
79
78
|
} else {
|
|
80
79
|
GenericAd ad = null;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
80
|
+
String id = ctx.optId();
|
|
81
|
+
if (id != null && helper.ads.containsKey(id)) {
|
|
82
|
+
ad = (GenericAd) helper.getAd(id); // already exists..
|
|
83
|
+
} else {
|
|
84
|
+
switch (adClass) {
|
|
85
|
+
case "AppOpenAd":
|
|
86
|
+
ad = new AppOpen(ctx);
|
|
87
|
+
break;
|
|
88
|
+
case "BannerAd":
|
|
89
|
+
ad = new Banner(ctx);
|
|
90
|
+
break;
|
|
91
|
+
case "InterstitialAd":
|
|
92
|
+
ad = new Interstitial(ctx);
|
|
93
|
+
break;
|
|
94
|
+
case "NativeAd":
|
|
95
|
+
ad = new Native(ctx);
|
|
96
|
+
break;
|
|
97
|
+
case "RewardedAd":
|
|
98
|
+
ad = new Rewarded(ctx);
|
|
99
|
+
break;
|
|
100
|
+
case "RewardedInterstitialAd":
|
|
101
|
+
ad = new RewardedInterstitial(ctx);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
100
104
|
}
|
|
101
105
|
if (ad != null) {
|
|
102
106
|
ctx.resolve();
|
package/src/ios/AMBPlugin.swift
CHANGED
|
@@ -91,31 +91,36 @@ class AMBPlugin: CDVPlugin {
|
|
|
91
91
|
let ctx = AMBContext(command)
|
|
92
92
|
|
|
93
93
|
DispatchQueue.main.async {
|
|
94
|
-
|
|
94
|
+
let adClass = ctx.optString("cls")
|
|
95
|
+
if adClass == nil { // class missing..
|
|
96
|
+
ctx.reject("ad cls is missing")
|
|
97
|
+
} else {
|
|
95
98
|
var ad: AMBCoreAd?
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
if let id = ctx.optId(), let existing = AMBCoreAd.ads[id] {
|
|
100
|
+
ad = existing // already exists..
|
|
101
|
+
} else {
|
|
102
|
+
switch adClass {
|
|
103
|
+
case "AppOpenAd":
|
|
104
|
+
ad = AMBAppOpenAd(ctx)
|
|
105
|
+
case "BannerAd":
|
|
106
|
+
ad = AMBBanner(ctx)
|
|
107
|
+
case "InterstitialAd":
|
|
108
|
+
ad = AMBInterstitial(ctx)
|
|
109
|
+
case "NativeAd":
|
|
110
|
+
ad = AMBNativeAd(ctx)
|
|
111
|
+
case "RewardedAd":
|
|
112
|
+
ad = AMBRewarded(ctx)
|
|
113
|
+
case "RewardedInterstitialAd":
|
|
114
|
+
ad = AMBRewardedInterstitial(ctx)
|
|
115
|
+
default:
|
|
116
|
+
break
|
|
117
|
+
}
|
|
111
118
|
}
|
|
112
119
|
if ad != nil {
|
|
113
120
|
ctx.resolve()
|
|
114
121
|
} else {
|
|
115
122
|
ctx.reject("fail to create ad: \(ctx.optId() ?? "-")")
|
|
116
123
|
}
|
|
117
|
-
} else {
|
|
118
|
-
ctx.reject()
|
|
119
124
|
}
|
|
120
125
|
}
|
|
121
126
|
}
|