cordova-admob-tomitank 1.1.6 → 1.1.7
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/esm/api.d.ts +1 -1
- package/lib/api.d.ts +1 -1
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/android/cordova/AdMob.java +9 -8
- package/src/android/core/Ad.java +2 -2
- package/src/android/core/Context.java +2 -2
- package/src/android/core/Helper.java +2 -2
- package/src/www/api.ts +1 -1
package/esm/api.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare class MobileAd<T extends MobileAdOptions = MobileAdOptions> {
|
|
|
21
21
|
private _created;
|
|
22
22
|
private _init;
|
|
23
23
|
constructor(opts: T);
|
|
24
|
-
static getAdById(id: string):
|
|
24
|
+
static getAdById(id: string): MobileAd<MobileAdOptions>;
|
|
25
25
|
get adUnitId(): string;
|
|
26
26
|
on(...args: Parameters<typeof document.addEventListener>): () => void;
|
|
27
27
|
protected isLoaded(): Promise<boolean>;
|
package/lib/api.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare class MobileAd<T extends MobileAdOptions = MobileAdOptions> {
|
|
|
21
21
|
private _created;
|
|
22
22
|
private _init;
|
|
23
23
|
constructor(opts: T);
|
|
24
|
-
static getAdById(id: string):
|
|
24
|
+
static getAdById(id: string): MobileAd<MobileAdOptions>;
|
|
25
25
|
get adUnitId(): string;
|
|
26
26
|
on(...args: Parameters<typeof document.addEventListener>): () => void;
|
|
27
27
|
protected isLoaded(): Promise<boolean>;
|
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.1.
|
|
2
|
+
<plugin id="cordova-admob-tomitank" version="1.1.7"
|
|
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>
|
|
@@ -27,6 +27,7 @@ import admob.plus.cordova.ads.Rewarded;
|
|
|
27
27
|
import admob.plus.cordova.ads.RewardedInterstitial;
|
|
28
28
|
import admob.plus.core.GenericAd;
|
|
29
29
|
import admob.plus.core.Helper;
|
|
30
|
+
import admob.plus.core.Ad;
|
|
30
31
|
|
|
31
32
|
import static admob.plus.core.Helper.ads;
|
|
32
33
|
|
|
@@ -195,16 +196,16 @@ public class AdMob extends CordovaPlugin implements Helper.Adapter {
|
|
|
195
196
|
public void onConfigurationChanged(Configuration newConfig) {
|
|
196
197
|
super.onConfigurationChanged(newConfig);
|
|
197
198
|
|
|
198
|
-
for (
|
|
199
|
-
AdBase ad = (AdBase)
|
|
199
|
+
for (Map.Entry<String, Ad> entry : ads.entrySet()) {
|
|
200
|
+
AdBase ad = (AdBase) entry.getValue();
|
|
200
201
|
ad.onConfigurationChanged(newConfig);
|
|
201
202
|
}
|
|
202
203
|
}
|
|
203
204
|
|
|
204
205
|
@Override
|
|
205
206
|
public void onPause(boolean multitasking) {
|
|
206
|
-
for (
|
|
207
|
-
AdBase ad = (AdBase)
|
|
207
|
+
for (Map.Entry<String, Ad> entry : ads.entrySet()) {
|
|
208
|
+
AdBase ad = (AdBase) entry.getValue();
|
|
208
209
|
ad.onPause(multitasking);
|
|
209
210
|
}
|
|
210
211
|
super.onPause(multitasking);
|
|
@@ -213,8 +214,8 @@ public class AdMob extends CordovaPlugin implements Helper.Adapter {
|
|
|
213
214
|
@Override
|
|
214
215
|
public void onResume(boolean multitasking) {
|
|
215
216
|
super.onResume(multitasking);
|
|
216
|
-
for (
|
|
217
|
-
AdBase ad = (AdBase)
|
|
217
|
+
for (Map.Entry<String, Ad> entry : ads.entrySet()) {
|
|
218
|
+
AdBase ad = (AdBase) entry.getValue();
|
|
218
219
|
ad.onResume(multitasking);
|
|
219
220
|
}
|
|
220
221
|
}
|
|
@@ -223,8 +224,8 @@ public class AdMob extends CordovaPlugin implements Helper.Adapter {
|
|
|
223
224
|
public void onDestroy() {
|
|
224
225
|
readyCallbackContext = null;
|
|
225
226
|
|
|
226
|
-
for (
|
|
227
|
-
AdBase ad = (AdBase)
|
|
227
|
+
for (Map.Entry<String, Ad> entry : ads.entrySet()) {
|
|
228
|
+
AdBase ad = (AdBase) entry.getValue();
|
|
228
229
|
ad.onDestroy();
|
|
229
230
|
}
|
|
230
231
|
|
package/src/android/core/Ad.java
CHANGED
|
@@ -16,10 +16,10 @@ import java.util.Objects;
|
|
|
16
16
|
import static admob.plus.core.Helper.ads;
|
|
17
17
|
|
|
18
18
|
public abstract class Ad {
|
|
19
|
-
public final
|
|
19
|
+
public final String id;
|
|
20
20
|
public final String adUnitId;
|
|
21
21
|
|
|
22
|
-
public Ad(
|
|
22
|
+
public Ad(String id, @NonNull String adUnitId) {
|
|
23
23
|
this.id = id;
|
|
24
24
|
this.adUnitId = adUnitId;
|
|
25
25
|
ads.put(id, this);
|
|
@@ -26,14 +26,14 @@ import java.util.List;
|
|
|
26
26
|
import java.util.Map;
|
|
27
27
|
|
|
28
28
|
public class Helper {
|
|
29
|
-
public static final
|
|
29
|
+
public static final Map<String, Ad> ads = new HashMap<>();
|
|
30
30
|
private final Adapter adapter;
|
|
31
31
|
|
|
32
32
|
public Helper(Adapter adapter) {
|
|
33
33
|
this.adapter = adapter;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
public static Ad getAd(
|
|
36
|
+
public static Ad getAd(String id) {
|
|
37
37
|
return ads.get(id);
|
|
38
38
|
}
|
|
39
39
|
|
package/src/www/api.ts
CHANGED
|
@@ -26,7 +26,7 @@ export async function start() {
|
|
|
26
26
|
export class MobileAd<T extends MobileAdOptions = MobileAdOptions> {
|
|
27
27
|
public static readonly type: string = ''
|
|
28
28
|
|
|
29
|
-
private static allAds: { [s:
|
|
29
|
+
private static allAds: { [s: string]: MobileAd } = {}
|
|
30
30
|
private static idCounter = 0
|
|
31
31
|
|
|
32
32
|
public readonly id: string
|