cordova-admob-tomitank 1.1.6 → 1.1.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 CHANGED
@@ -1,8 +1,8 @@
1
1
  # [Cordova AdMob tomitank]
2
2
 
3
3
  Based on AdMob Plus Cordova with updated SDK-s
4
- - Android: 24.4.0
5
- - iOS: 12.7.0
4
+ - Android: 24.5.0
5
+ - iOS: 12.9.0
6
6
 
7
7
  [![](https://img.shields.io/static/v1?label=Sponsor%20Me&style=for-the-badge&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/tomitank)
8
8
 
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): any;
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): any;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-admob-tomitank",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "Trustable Google AdMob Cordova Plugin",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",
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.6"
2
+ <plugin id="cordova-admob-tomitank" version="1.1.8"
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>
@@ -20,7 +20,7 @@
20
20
 
21
21
  <platform name="android">
22
22
  <preference name="APP_ID_ANDROID" default="ca-app-pub-xxx~yyy" />
23
- <preference name="PLAY_SERVICES_VERSION" default="24.4.0" />
23
+ <preference name="PLAY_SERVICES_VERSION" default="24.5.0" />
24
24
 
25
25
  <config-file target="AndroidManifest.xml" parent="/manifest/application">
26
26
  <activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:excludeFromRecents="true" android:name="com.google.android.gms.ads.AdActivity" android:noHistory="true" />
@@ -317,7 +317,7 @@
317
317
  <source url="https://cdn.cocoapods.org/" />
318
318
  </config>
319
319
  <pods use-frameworks="true">
320
- <pod name="Google-Mobile-Ads-SDK" spec="~> 12.7.0" />
320
+ <pod name="Google-Mobile-Ads-SDK" spec="~> 12.9.0" />
321
321
  </pods>
322
322
  </podspec>
323
323
  </platform>
@@ -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 (int i = 0; i < ads.size(); i++) {
199
- AdBase ad = (AdBase) ads.valueAt(i);
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 (int i = 0; i < ads.size(); i++) {
207
- AdBase ad = (AdBase) ads.valueAt(i);
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 (int i = 0; i < ads.size(); i++) {
217
- AdBase ad = (AdBase) ads.valueAt(i);
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 (int i = 0; i < ads.size(); i++) {
227
- AdBase ad = (AdBase) ads.valueAt(i);
227
+ for (Map.Entry<String, Ad> entry : ads.entrySet()) {
228
+ AdBase ad = (AdBase) entry.getValue();
228
229
  ad.onDestroy();
229
230
  }
230
231
 
@@ -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 int id;
19
+ public final String id;
20
20
  public final String adUnitId;
21
21
 
22
- public Ad(int id, @NonNull String adUnitId) {
22
+ public Ad(String id, @NonNull String adUnitId) {
23
23
  this.id = id;
24
24
  this.adUnitId = adUnitId;
25
25
  ads.put(id, this);
@@ -77,8 +77,8 @@ public interface Context {
77
77
  }
78
78
 
79
79
  @Nullable
80
- default Integer optId() {
81
- return this.optInt("id");
80
+ default String optId() {
81
+ return this.optString("id");
82
82
  }
83
83
 
84
84
  @Nullable
@@ -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 SparseArray<Ad> ads = new SparseArray<Ad>();
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(Integer id) {
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: number]: MobileAd } = {}
29
+ private static allAds: { [s: string]: MobileAd } = {}
30
30
  private static idCounter = 0
31
31
 
32
32
  public readonly id: string