react-native-applovin-max 8.0.0 → 8.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/android/build.gradle +2 -2
- package/lib/commonjs/AdView.js +86 -98
- package/lib/commonjs/AdView.js.map +1 -1
- package/lib/commonjs/AppLovinMAX.js +1 -1
- package/lib/commonjs/AppOpenAd.js +7 -7
- package/lib/commonjs/AppOpenAd.js.map +1 -1
- package/lib/commonjs/BannerAd.js +8 -8
- package/lib/commonjs/BannerAd.js.map +1 -1
- package/lib/commonjs/EventEmitter.js.map +1 -1
- package/lib/commonjs/InterstitialAd.js +7 -7
- package/lib/commonjs/InterstitialAd.js.map +1 -1
- package/lib/commonjs/MRecAd.js +6 -6
- package/lib/commonjs/MRecAd.js.map +1 -1
- package/lib/commonjs/RewardedAd.js +8 -8
- package/lib/commonjs/RewardedAd.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdView.js +26 -29
- package/lib/commonjs/nativeAd/NativeAdView.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js +69 -102
- package/lib/commonjs/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js +13 -13
- package/lib/commonjs/nativeAd/NativeAdViewProvider.js.map +1 -1
- package/lib/module/AdView.js +87 -99
- package/lib/module/AdView.js.map +1 -1
- package/lib/module/AppLovinMAX.js +1 -1
- package/lib/module/AppOpenAd.js +7 -7
- package/lib/module/AppOpenAd.js.map +1 -1
- package/lib/module/BannerAd.js +8 -8
- package/lib/module/BannerAd.js.map +1 -1
- package/lib/module/EventEmitter.js.map +1 -1
- package/lib/module/InterstitialAd.js +7 -7
- package/lib/module/InterstitialAd.js.map +1 -1
- package/lib/module/MRecAd.js +6 -6
- package/lib/module/MRecAd.js.map +1 -1
- package/lib/module/RewardedAd.js +8 -8
- package/lib/module/RewardedAd.js.map +1 -1
- package/lib/module/nativeAd/NativeAdView.js +27 -30
- package/lib/module/nativeAd/NativeAdView.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewComponents.js +71 -104
- package/lib/module/nativeAd/NativeAdViewComponents.js.map +1 -1
- package/lib/module/nativeAd/NativeAdViewProvider.js +13 -13
- package/lib/module/nativeAd/NativeAdViewProvider.js.map +1 -1
- package/lib/typescript/src/AdView.d.ts +2 -2
- package/lib/typescript/src/AdView.d.ts.map +1 -1
- package/lib/typescript/src/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/src/nativeAd/NativeAdView.d.ts.map +1 -1
- package/lib/typescript/src/nativeAd/NativeAdViewComponents.d.ts.map +1 -1
- package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts +3 -2
- package/lib/typescript/src/nativeAd/NativeAdViewProvider.d.ts.map +1 -1
- package/lib/typescript/src/types/AdInfo.d.ts +2 -2
- package/lib/typescript/src/types/NativeAd.d.ts +3 -3
- package/lib/typescript/src/types/NativeAd.d.ts.map +1 -1
- package/lib/typescript/src/types/Privacy.d.ts +0 -2
- package/lib/typescript/src/types/Privacy.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-applovin-max.podspec +1 -1
- package/src/AdView.tsx +103 -92
- package/src/AppLovinMAX.ts +1 -1
- package/src/AppOpenAd.ts +21 -21
- package/src/BannerAd.ts +20 -20
- package/src/EventEmitter.ts +2 -2
- package/src/InterstitialAd.ts +21 -21
- package/src/MRecAd.ts +18 -18
- package/src/RewardedAd.ts +24 -24
- package/src/nativeAd/NativeAdView.tsx +41 -29
- package/src/nativeAd/NativeAdViewComponents.tsx +72 -98
- package/src/nativeAd/NativeAdViewProvider.tsx +21 -15
- package/src/types/AdInfo.ts +2 -2
- package/src/types/NativeAd.ts +3 -3
- package/src/types/Privacy.ts +0 -4
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useState, createContext } from 'react';
|
|
3
|
+
const defaultNativeAd = {
|
|
4
|
+
isOptionsViewAvailable: false,
|
|
5
|
+
isMediaViewAvailable: false
|
|
6
|
+
};
|
|
3
7
|
export const NativeAdViewContext = /*#__PURE__*/createContext({
|
|
4
|
-
nativeAd:
|
|
5
|
-
isOptionsViewAvailable: false,
|
|
6
|
-
isMediaViewAvailable: false
|
|
7
|
-
},
|
|
8
|
+
nativeAd: defaultNativeAd,
|
|
8
9
|
nativeAdView: null,
|
|
9
10
|
setNativeAd: () => {},
|
|
10
11
|
setNativeAdView: () => {}
|
|
11
12
|
});
|
|
12
|
-
export const NativeAdViewProvider =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const providerValue = {
|
|
13
|
+
export const NativeAdViewProvider = ({
|
|
14
|
+
children
|
|
15
|
+
}) => {
|
|
16
|
+
const [nativeAd, setNativeAd] = useState(defaultNativeAd);
|
|
17
|
+
const [nativeAdView, setNativeAdView] = useState(null);
|
|
18
|
+
const providerValue = React.useMemo(() => ({
|
|
19
19
|
nativeAd,
|
|
20
20
|
nativeAdView,
|
|
21
21
|
setNativeAd,
|
|
22
22
|
setNativeAdView
|
|
23
|
-
};
|
|
23
|
+
}), [nativeAd, nativeAdView]);
|
|
24
24
|
return /*#__PURE__*/React.createElement(NativeAdViewContext.Provider, {
|
|
25
25
|
value: providerValue
|
|
26
|
-
},
|
|
26
|
+
}, children);
|
|
27
27
|
};
|
|
28
28
|
//# sourceMappingURL=NativeAdViewProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","createContext","
|
|
1
|
+
{"version":3,"names":["React","useState","createContext","defaultNativeAd","isOptionsViewAvailable","isMediaViewAvailable","NativeAdViewContext","nativeAd","nativeAdView","setNativeAd","setNativeAdView","NativeAdViewProvider","children","providerValue","useMemo","createElement","Provider","value"],"sourceRoot":"../../../src","sources":["nativeAd/NativeAdViewProvider.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,aAAa,QAAQ,OAAO;AAe/C,MAAMC,eAAyB,GAAG;EAC9BC,sBAAsB,EAAE,KAAK;EAC7BC,oBAAoB,EAAE;AAC1B,CAAC;AAED,OAAO,MAAMC,mBAAmB,gBAAGJ,aAAa,CAA0B;EACtEK,QAAQ,EAAEJ,eAAe;EACzBK,YAAY,EAAE,IAAI;EAClBC,WAAW,EAAEA,CAAA,KAAM,CAAC,CAAC;EACrBC,eAAe,EAAEA,CAAA,KAAM,CAAC;AAC5B,CAAC,CAAC;AAEF,OAAO,MAAMC,oBAAuD,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EACrF,MAAM,CAACL,QAAQ,EAAEE,WAAW,CAAC,GAAGR,QAAQ,CAAWE,eAAe,CAAC;EACnE,MAAM,CAACK,YAAY,EAAEE,eAAe,CAAC,GAAGT,QAAQ,CAA0B,IAAI,CAAC;EAE/E,MAAMY,aAAa,GAAGb,KAAK,CAACc,OAAO,CAC/B,OAAO;IACHP,QAAQ;IACRC,YAAY;IACZC,WAAW;IACXC;EACJ,CAAC,CAAC,EACF,CAACH,QAAQ,EAAEC,YAAY,CAC3B,CAAC;EAED,oBAAOR,KAAA,CAAAe,aAAA,CAACT,mBAAmB,CAACU,QAAQ;IAACC,KAAK,EAAEJ;EAAc,GAAED,QAAuC,CAAC;AACxG,CAAC","ignoreList":[]}
|
|
@@ -30,8 +30,8 @@ export declare enum AdViewPosition {
|
|
|
30
30
|
BOTTOM_RIGHT
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* The {@link AdView} component that you use building a banner or an MREC. Phones
|
|
34
|
-
*
|
|
33
|
+
* The {@link AdView} component that you use for building a banner or an MREC. Phones
|
|
34
|
+
* size banners to 320x50 and MRECs to 300x250. Tablets size banners to 728x90 and MRECs to
|
|
35
35
|
* 300x250. You may use the utility method {@link AppLovinMAX.isTablet()} to help with view sizing
|
|
36
36
|
* adjustments. For adaptive banners, call {@link BannerAd.getAdaptiveHeightForWidth()} to get
|
|
37
37
|
* the banner height, and then adjust your content accordingly.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdView.d.ts","sourceRoot":"","sources":["../../../src/AdView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAuD,MAAM,cAAc,CAAC;AACnG,OAAO,KAAK,EAAuB,MAAM,EAAE,gBAAgB,EAAiB,MAAM,gBAAgB,CAAC;AAEnG,OAAO,KAAK,EAAe,aAAa,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AAuBtG;;GAEG;AACH,oBAAY,QAAQ;IAChB;;OAEG;IACH,MAA+B;IAE/B;;OAEG;IACH,IAA2B;CAC9B;AAED;;GAEG;AACH,oBAAY,cAAc;IACtB,UAAgC;IAChC,QAA4B;IAC5B,SAA8B;IAC9B,QAA4B;IAC5B,WAAkC;IAClC,YAAoC;IACpC,WAAkC;IAClC,aAAsC;IACtC,YAAoC;CACvC;
|
|
1
|
+
{"version":3,"file":"AdView.d.ts","sourceRoot":"","sources":["../../../src/AdView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAuD,MAAM,cAAc,CAAC;AACnG,OAAO,KAAK,EAAuB,MAAM,EAAE,gBAAgB,EAAiB,MAAM,gBAAgB,CAAC;AAEnG,OAAO,KAAK,EAAe,aAAa,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AAuBtG;;GAEG;AACH,oBAAY,QAAQ;IAChB;;OAEG;IACH,MAA+B;IAE/B;;OAEG;IACH,IAA2B;CAC9B;AAED;;GAEG;AACH,oBAAY,cAAc;IACtB,UAAgC;IAChC,QAA4B;IAC5B,SAA8B;IAC9B,QAA4B;IAC5B,WAAkC;IAClC,YAAoC;IACpC,WAAkC;IAClC,aAAsC;IACtC,YAAoC;CACvC;AAqDD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM;;;;;;;mDAyKjB,CAAC;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,8BAA8B,aAAoB,MAAM,YAAY,QAAQ,YAAY,8BAA8B,KAAG,QAAQ,IAAI,CAEjJ,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,aAAoB,MAAM,KAAG,QAAQ,IAAI,CAEnF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,+CAA+C,aAAc,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,KAAG,IAEpG,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kDAAkD,QAAO,IAErE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mDAAmD,aAAc,CAAC,SAAS,EAAE,gBAAgB,KAAK,IAAI,KAAG,IAErH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sDAAsD,QAAO,IAEzE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../../src/EventEmitter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAStE,eAAO,MAAM,gBAAgB,mCAAoC,MAAM,WAAW,gBAAgB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../../src/EventEmitter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAStE,eAAO,MAAM,gBAAgB,mCAAoC,MAAM,WAAW,gBAAgB,CAAC,CAAC,KAAG,IAOtG,CAAC;AAEF,eAAO,MAAM,mBAAmB,UAAW,MAAM,KAAG,IAMnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAdView.d.ts","sourceRoot":"","sources":["../../../../src/nativeAd/NativeAdView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAK9C,OAAO,KAAK,EAAE,mBAAmB,EAAqB,MAAM,4BAA4B,CAAC;AAczF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"NativeAdView.d.ts","sourceRoot":"","sources":["../../../../src/nativeAd/NativeAdView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAK9C,OAAO,KAAK,EAAE,mBAAmB,EAAqB,MAAM,4BAA4B,CAAC;AAczF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,YAAY,4HAyBvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAdViewComponents.d.ts","sourceRoot":"","sources":["../../../../src/nativeAd/NativeAdViewComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeAdViewComponents.d.ts","sourceRoot":"","sources":["../../../../src/nativeAd/NativeAdViewComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAwB,SAAS,EAAE,MAAM,cAAc,CAAC;AAsB3F,eAAO,MAAM,SAAS,UAAW,SAAS,sBASzC,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,SAAS,sBAS9C,CAAC;AAEF,eAAO,MAAM,QAAQ,UAAW,SAAS,sBASxC,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAW,SAAS,sBAoBhD,CAAC;AAEF,eAAO,MAAM,QAAQ,UAAW,KAAK,UAAU,EAAE,QAAQ,CAAC,sBAWzD,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,SAAS,sBAK3C,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,SAAS,sBAKzC,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,SAAS,sBAwC9C,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
2
3
|
import type { NativeMethods } from 'react-native';
|
|
3
4
|
import type { NativeAd } from '../types/NativeAd';
|
|
4
5
|
import type { NativeAdViewProps } from '../types/NativeAdViewProps';
|
|
@@ -7,10 +8,10 @@ export type NativeAdViewContextType = {
|
|
|
7
8
|
nativeAd: NativeAd;
|
|
8
9
|
nativeAdView: NativeAdViewType | null;
|
|
9
10
|
setNativeAd: React.Dispatch<React.SetStateAction<NativeAd>>;
|
|
10
|
-
setNativeAdView: React.Dispatch<React.SetStateAction<NativeAdViewType>>;
|
|
11
|
+
setNativeAdView: React.Dispatch<React.SetStateAction<NativeAdViewType | null>>;
|
|
11
12
|
};
|
|
12
13
|
export declare const NativeAdViewContext: React.Context<NativeAdViewContextType>;
|
|
13
14
|
export declare const NativeAdViewProvider: React.FC<{
|
|
14
|
-
children:
|
|
15
|
+
children: ReactNode;
|
|
15
16
|
}>;
|
|
16
17
|
//# sourceMappingURL=NativeAdViewProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAdViewProvider.d.ts","sourceRoot":"","sources":["../../../../src/nativeAd/NativeAdViewProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,aAAa,CAAC;AAElF,MAAM,MAAM,uBAAuB,GAAG;IAClC,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACtC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5D,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeAdViewProvider.d.ts","sourceRoot":"","sources":["../../../../src/nativeAd/NativeAdViewProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,aAAa,CAAC;AAElF,MAAM,MAAM,uBAAuB,GAAG;IAClC,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACtC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5D,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC,CAAC;CAClF,CAAC;AAOF,eAAO,MAAM,mBAAmB,wCAK9B,CAAC;AAEH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAelE,CAAC"}
|
|
@@ -27,7 +27,7 @@ export type AdInfo = {
|
|
|
27
27
|
placement?: string | null;
|
|
28
28
|
/**
|
|
29
29
|
* The ad’s revenue amount. In the case where no revenue amount exists, or it is not available
|
|
30
|
-
* yet,
|
|
30
|
+
* yet, returns 0.
|
|
31
31
|
*/
|
|
32
32
|
revenue: number;
|
|
33
33
|
/**
|
|
@@ -201,7 +201,7 @@ export type AdWaterfallInfo = {
|
|
|
201
201
|
*/
|
|
202
202
|
networkResponses: AdNetworkResponseInfo[];
|
|
203
203
|
/**
|
|
204
|
-
* The total latency in
|
|
204
|
+
* The total latency in milliseconds for this waterfall to finish processing.
|
|
205
205
|
*/
|
|
206
206
|
latencyMillis: number;
|
|
207
207
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Represents a native ad for rendering
|
|
2
|
+
* Represents a native ad for rendering in {@link NativeAdView}. This type is intended for internal use only.
|
|
3
3
|
*/
|
|
4
4
|
export type NativeAd = {
|
|
5
5
|
/**
|
|
@@ -25,11 +25,11 @@ export type NativeAd = {
|
|
|
25
25
|
/**
|
|
26
26
|
* The URL string of the icon.
|
|
27
27
|
*/
|
|
28
|
-
url?: string
|
|
28
|
+
url?: string;
|
|
29
29
|
/**
|
|
30
30
|
* The star rating of the native ad.
|
|
31
31
|
*/
|
|
32
|
-
starRating?: number
|
|
32
|
+
starRating?: number;
|
|
33
33
|
/**
|
|
34
34
|
* Whether or not the Options view is available.
|
|
35
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAd.d.ts","sourceRoot":"","sources":["../../../../src/types/NativeAd.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"NativeAd.d.ts","sourceRoot":"","sources":["../../../../src/types/NativeAd.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAC;CACjC,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export type PrivacyType = {
|
|
2
|
-
/**********************************************************************************/
|
|
3
|
-
/**********************************************************************************/
|
|
4
2
|
/**
|
|
5
3
|
* Sets whether or not the user provided consent for information-sharing with AppLovin.
|
|
6
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Privacy.d.ts","sourceRoot":"","sources":["../../../../src/types/Privacy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACtB
|
|
1
|
+
{"version":3,"file":"Privacy.d.ts","sourceRoot":"","sources":["../../../../src/types/Privacy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACtB;;;;OAIG;IACH,iBAAiB,CAAC,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAEjD;;OAEG;IACH,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnC;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAEvC;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-applovin-max",
|
|
3
3
|
"author": "AppLovin Corporation <support@applovin.com> (https://applovin.com)",
|
|
4
|
-
"version": "8.0.
|
|
4
|
+
"version": "8.0.1",
|
|
5
5
|
"description": "AppLovin MAX React Native Plugin for Android and iOS",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
7
7
|
"module": "lib/module/index",
|
|
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
|
|
|
12
12
|
s.authors = package["author"]
|
|
13
13
|
|
|
14
14
|
s.platforms = { :ios => min_ios_version_supported }
|
|
15
|
-
s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "
|
|
15
|
+
s.source = { :git => "https://github.com/AppLovin/AppLovin-MAX-React-Native.git", :tag => "release_8_0_1" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/AppLovinMAX*.{h,m}"
|
|
18
18
|
|
package/src/AdView.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useEffect, useState, useRef, useCallback, useImperativeHandle, useReducer, forwardRef } from 'react';
|
|
3
|
-
import { NativeModules, requireNativeComponent, StyleSheet, UIManager, findNodeHandle, useWindowDimensions } from 'react-native';
|
|
3
|
+
import { NativeModules, requireNativeComponent, StyleSheet, UIManager, findNodeHandle, useWindowDimensions, View } from 'react-native';
|
|
4
4
|
import type { ViewProps, ViewStyle, StyleProp, NativeMethods, DimensionValue } from 'react-native';
|
|
5
5
|
import type { AdDisplayFailedInfo, AdInfo, AdLoadFailedInfo, AdRevenueInfo } from './types/AdInfo';
|
|
6
6
|
import type { AdNativeEvent } from './types/AdEvent';
|
|
@@ -81,35 +81,36 @@ const ADVIEW_SIZE = {
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
// Returns 'auto' for unspecified width / height
|
|
84
|
-
const getOutlineViewSize = (style: StyleProp<ViewStyle>) => {
|
|
85
|
-
const viewStyle = StyleSheet.flatten(style || {}
|
|
86
|
-
return [viewStyle
|
|
84
|
+
const getOutlineViewSize = (style: StyleProp<ViewStyle>): [DimensionValue, DimensionValue] => {
|
|
85
|
+
const viewStyle = StyleSheet.flatten(style) || {};
|
|
86
|
+
return [viewStyle.width ?? 'auto', viewStyle.height ?? 'auto'];
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
const sizeBannerDimensions = (sizeProps: SizeRecord, adaptiveBannerEnabled: boolean, screenWidth: number, bannerFormatSize: SizeRecord): Promise<SizeRecord> => {
|
|
90
|
-
const
|
|
91
|
-
const width = sizeProps.width === 'auto' ? screenWidth : sizeProps.width;
|
|
89
|
+
const sizeBannerDimensions = async (sizeProps: SizeRecord, adaptiveBannerEnabled: boolean, screenWidth: number, bannerFormatSize: SizeRecord): Promise<SizeRecord> => {
|
|
90
|
+
const width = sizeProps.width === 'auto' ? screenWidth : sizeProps.width;
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
let height;
|
|
93
|
+
if (sizeProps.height === 'auto') {
|
|
94
|
+
if (adaptiveBannerEnabled) {
|
|
95
|
+
try {
|
|
96
96
|
height = await AppLovinMAX.getAdaptiveBannerHeightForWidth(screenWidth);
|
|
97
|
-
}
|
|
97
|
+
} catch (error) {
|
|
98
|
+
console.error('Error getting adaptive banner height:', error);
|
|
98
99
|
height = bannerFormatSize.height;
|
|
99
100
|
}
|
|
100
101
|
} else {
|
|
101
|
-
height =
|
|
102
|
+
height = bannerFormatSize.height;
|
|
102
103
|
}
|
|
104
|
+
} else {
|
|
105
|
+
height = sizeProps.height;
|
|
106
|
+
}
|
|
103
107
|
|
|
104
|
-
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
return sizeForBannerFormat();
|
|
108
|
+
return { width, height };
|
|
108
109
|
};
|
|
109
110
|
|
|
110
111
|
/**
|
|
111
|
-
* The {@link AdView} component that you use building a banner or an MREC. Phones
|
|
112
|
-
*
|
|
112
|
+
* The {@link AdView} component that you use for building a banner or an MREC. Phones
|
|
113
|
+
* size banners to 320x50 and MRECs to 300x250. Tablets size banners to 728x90 and MRECs to
|
|
113
114
|
* 300x250. You may use the utility method {@link AppLovinMAX.isTablet()} to help with view sizing
|
|
114
115
|
* adjustments. For adaptive banners, call {@link BannerAd.getAdaptiveHeightForWidth()} to get
|
|
115
116
|
* the banner height, and then adjust your content accordingly.
|
|
@@ -161,7 +162,7 @@ export const AdView = forwardRef<AdViewHandler, AdViewProps & ViewProps>(functio
|
|
|
161
162
|
const sizeProps = useRef<SizeRecord>({});
|
|
162
163
|
const dimensions = useRef<SizeRecord>({});
|
|
163
164
|
|
|
164
|
-
const loadAd = () => {
|
|
165
|
+
const loadAd = useCallback(() => {
|
|
165
166
|
if (adViewRef.current) {
|
|
166
167
|
UIManager.dispatchViewManagerCommand(
|
|
167
168
|
findNodeHandle(adViewRef.current),
|
|
@@ -170,100 +171,110 @@ export const AdView = forwardRef<AdViewHandler, AdViewProps & ViewProps>(functio
|
|
|
170
171
|
undefined
|
|
171
172
|
);
|
|
172
173
|
}
|
|
173
|
-
};
|
|
174
|
+
}, []);
|
|
174
175
|
|
|
175
|
-
useImperativeHandle(ref, () => ({ loadAd }), []);
|
|
176
|
+
useImperativeHandle(ref, () => ({ loadAd }), [loadAd]);
|
|
176
177
|
|
|
177
178
|
const saveElement = useCallback((element: AdViewType | null) => {
|
|
178
|
-
|
|
179
|
-
adViewRef.current = element;
|
|
180
|
-
}
|
|
179
|
+
adViewRef.current = element;
|
|
181
180
|
}, []);
|
|
182
181
|
|
|
183
182
|
useEffect(() => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
adFormatSize.current = { width: ADVIEW_SIZE.mrec.width, height: ADVIEW_SIZE.mrec.height };
|
|
194
|
-
}
|
|
183
|
+
(async () => {
|
|
184
|
+
if (adFormat === AdFormat.BANNER) {
|
|
185
|
+
const isTablet = await AppLovinMAX.isTablet();
|
|
186
|
+
adFormatSize.current = isTablet
|
|
187
|
+
? { width: ADVIEW_SIZE.leader.width, height: ADVIEW_SIZE.leader.height }
|
|
188
|
+
: { width: ADVIEW_SIZE.banner.width, height: ADVIEW_SIZE.banner.height };
|
|
189
|
+
} else {
|
|
190
|
+
adFormatSize.current = { width: ADVIEW_SIZE.mrec.width, height: ADVIEW_SIZE.mrec.height };
|
|
191
|
+
}
|
|
195
192
|
|
|
196
|
-
|
|
197
|
-
setIsInitialized(
|
|
198
|
-
if (!
|
|
193
|
+
const initialized = await AppLovinMAX.isInitialized();
|
|
194
|
+
setIsInitialized(initialized);
|
|
195
|
+
if (!initialized) {
|
|
199
196
|
console.warn('AdView is mounted before the initialization of the AppLovin MAX React Native module');
|
|
200
197
|
}
|
|
201
|
-
});
|
|
202
|
-
}, [adFormat]);
|
|
198
|
+
})();
|
|
199
|
+
}, [adFormat]);
|
|
203
200
|
|
|
204
201
|
useEffect(() => {
|
|
205
|
-
if (!isInitialized) return;
|
|
206
|
-
|
|
207
202
|
const [width, height] = getOutlineViewSize(style);
|
|
208
203
|
|
|
209
204
|
if (sizeProps.current.width === width && sizeProps.current.height === height) return;
|
|
210
205
|
|
|
211
|
-
sizeProps.current = { width
|
|
206
|
+
sizeProps.current = { width, height };
|
|
207
|
+
|
|
208
|
+
(async () => {
|
|
209
|
+
if (adFormat === AdFormat.BANNER) {
|
|
210
|
+
const adaptedSize = await sizeBannerDimensions(sizeProps.current, adaptiveBannerEnabled, screenWidth, adFormatSize.current);
|
|
212
211
|
|
|
213
|
-
if (adFormat === AdFormat.BANNER) {
|
|
214
|
-
sizeBannerDimensions(sizeProps.current, adaptiveBannerEnabled, screenWidth, adFormatSize.current).then((adaptedSize: SizeRecord) => {
|
|
215
212
|
if (dimensions.current.width !== adaptedSize.width || dimensions.current.height !== adaptedSize.height) {
|
|
216
213
|
dimensions.current = adaptedSize;
|
|
217
214
|
forceUpdate();
|
|
218
215
|
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const onAdLoadedEvent = (
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
};
|
|
216
|
+
} else {
|
|
217
|
+
dimensions.current = {
|
|
218
|
+
width: width === 'auto' ? adFormatSize.current.width : width,
|
|
219
|
+
height: height === 'auto' ? adFormatSize.current.height : height,
|
|
220
|
+
};
|
|
221
|
+
forceUpdate();
|
|
222
|
+
}
|
|
223
|
+
})();
|
|
224
|
+
}, [adFormat, adaptiveBannerEnabled, isInitialized, screenWidth, style]);
|
|
225
|
+
|
|
226
|
+
const onAdLoadedEvent = useCallback(
|
|
227
|
+
(event: AdNativeEvent<AdInfo>) => {
|
|
228
|
+
onAdLoaded?.(event.nativeEvent);
|
|
229
|
+
},
|
|
230
|
+
[onAdLoaded]
|
|
231
|
+
);
|
|
236
232
|
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
233
|
+
const onAdLoadFailedEvent = useCallback(
|
|
234
|
+
(event: AdNativeEvent<AdLoadFailedInfo>) => {
|
|
235
|
+
onAdLoadFailed?.(event.nativeEvent);
|
|
236
|
+
},
|
|
237
|
+
[onAdLoadFailed]
|
|
238
|
+
);
|
|
240
239
|
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
240
|
+
const onAdDisplayFailedEvent = useCallback(
|
|
241
|
+
(event: AdNativeEvent<AdDisplayFailedInfo>) => {
|
|
242
|
+
onAdDisplayFailed?.(event.nativeEvent);
|
|
243
|
+
},
|
|
244
|
+
[onAdDisplayFailed]
|
|
245
|
+
);
|
|
244
246
|
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
const onAdClickedEvent = useCallback(
|
|
248
|
+
(event: AdNativeEvent<AdInfo>) => {
|
|
249
|
+
onAdClicked?.(event.nativeEvent);
|
|
250
|
+
},
|
|
251
|
+
[onAdClicked]
|
|
252
|
+
);
|
|
248
253
|
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
254
|
+
const onAdExpandedEvent = useCallback(
|
|
255
|
+
(event: AdNativeEvent<AdInfo>) => {
|
|
256
|
+
onAdExpanded?.(event.nativeEvent);
|
|
257
|
+
},
|
|
258
|
+
[onAdExpanded]
|
|
259
|
+
);
|
|
252
260
|
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
261
|
+
const onAdCollapsedEvent = useCallback(
|
|
262
|
+
(event: AdNativeEvent<AdInfo>) => {
|
|
263
|
+
onAdCollapsed?.(event.nativeEvent);
|
|
264
|
+
},
|
|
265
|
+
[onAdCollapsed]
|
|
266
|
+
);
|
|
256
267
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
268
|
+
const onAdRevenuePaidEvent = useCallback(
|
|
269
|
+
(event: AdNativeEvent<AdRevenueInfo>) => {
|
|
270
|
+
onAdRevenuePaid?.(event.nativeEvent);
|
|
271
|
+
},
|
|
272
|
+
[onAdRevenuePaid]
|
|
273
|
+
);
|
|
262
274
|
|
|
263
|
-
|
|
264
|
-
if
|
|
265
|
-
|
|
266
|
-
}
|
|
275
|
+
if (!isInitialized || Object.keys(dimensions.current).length === 0) {
|
|
276
|
+
// Early return if not initialized or dimensions are not set
|
|
277
|
+
return <View style={Object.assign({}, style, dimensions.current)} {...otherProps} />;
|
|
267
278
|
}
|
|
268
279
|
|
|
269
280
|
return (
|
|
@@ -332,14 +343,14 @@ export const destroyNativeUIComponentAdView = async (adUnitId: string): Promise<
|
|
|
332
343
|
*
|
|
333
344
|
* @param listener Listener to be notified.
|
|
334
345
|
*/
|
|
335
|
-
export const addNativeUIComponentAdViewAdLoadedEventListener = (listener: (adInfo: AdInfo) => void) => {
|
|
336
|
-
addEventListener(ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT,
|
|
346
|
+
export const addNativeUIComponentAdViewAdLoadedEventListener = (listener: (adInfo: AdInfo) => void): void => {
|
|
347
|
+
addEventListener(ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT, listener);
|
|
337
348
|
};
|
|
338
349
|
|
|
339
350
|
/**
|
|
340
351
|
* Removes the event listener to receive {@link AdInfo} when a native UI component loads a new ad.
|
|
341
352
|
*/
|
|
342
|
-
export const removeNativeUIComponentAdViewAdLoadedEventListener = () => {
|
|
353
|
+
export const removeNativeUIComponentAdViewAdLoadedEventListener = (): void => {
|
|
343
354
|
removeEventListener(ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOADED_EVENT);
|
|
344
355
|
};
|
|
345
356
|
|
|
@@ -349,14 +360,14 @@ export const removeNativeUIComponentAdViewAdLoadedEventListener = () => {
|
|
|
349
360
|
*
|
|
350
361
|
* @param listener Listener to be notified.
|
|
351
362
|
*/
|
|
352
|
-
export const addNativeUIComponentAdViewAdLoadFailedEventListener = (listener: (errorInfo: AdLoadFailedInfo) => void) => {
|
|
353
|
-
addEventListener(ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT,
|
|
363
|
+
export const addNativeUIComponentAdViewAdLoadFailedEventListener = (listener: (errorInfo: AdLoadFailedInfo) => void): void => {
|
|
364
|
+
addEventListener(ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT, listener);
|
|
354
365
|
};
|
|
355
366
|
|
|
356
367
|
/**
|
|
357
368
|
* Removes the event listener to receive {@link AdLoadFailedInfo} when a native UI component could
|
|
358
369
|
* not load a new ad.
|
|
359
370
|
*/
|
|
360
|
-
export const removeNativeUIComponentAdViewAdLoadFailedEventListener = () => {
|
|
371
|
+
export const removeNativeUIComponentAdViewAdLoadFailedEventListener = (): void => {
|
|
361
372
|
removeEventListener(ON_NATIVE_UI_COMPONENT_ADVIEW_AD_LOAD_FAILED_EVENT);
|
|
362
373
|
};
|
package/src/AppLovinMAX.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Configuration } from './types/Configuration';
|
|
|
4
4
|
|
|
5
5
|
const NativeAppLovinMAX = NativeModules.AppLovinMAX;
|
|
6
6
|
|
|
7
|
-
const VERSION = '8.0.
|
|
7
|
+
const VERSION = '8.0.1';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* This enum represents the user's geography used to determine the type of consent flow shown to the
|
package/src/AppOpenAd.ts
CHANGED
|
@@ -36,59 +36,59 @@ const setLocalExtraParameter = (adUnitId: string, key: string, value: LocalExtra
|
|
|
36
36
|
AppLovinMAX.setAppOpenAdLocalExtraParameter(adUnitId, { [key]: value });
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const addAdLoadedEventListener = (listener: (adInfo: AdInfo) => void) => {
|
|
40
|
-
addEventListener(ON_APPOPEN_AD_LOADED_EVENT,
|
|
39
|
+
const addAdLoadedEventListener = (listener: (adInfo: AdInfo) => void): void => {
|
|
40
|
+
addEventListener(ON_APPOPEN_AD_LOADED_EVENT, listener);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
const removeAdLoadedEventListener = () => {
|
|
43
|
+
const removeAdLoadedEventListener = (): void => {
|
|
44
44
|
removeEventListener(ON_APPOPEN_AD_LOADED_EVENT);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
const addAdLoadFailedEventListener = (listener: (errorInfo: AdLoadFailedInfo) => void) => {
|
|
48
|
-
addEventListener(ON_APPOPEN_AD_LOAD_FAILED_EVENT,
|
|
47
|
+
const addAdLoadFailedEventListener = (listener: (errorInfo: AdLoadFailedInfo) => void): void => {
|
|
48
|
+
addEventListener(ON_APPOPEN_AD_LOAD_FAILED_EVENT, listener);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
const removeAdLoadFailedEventListener = () => {
|
|
51
|
+
const removeAdLoadFailedEventListener = (): void => {
|
|
52
52
|
removeEventListener(ON_APPOPEN_AD_LOAD_FAILED_EVENT);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
const addAdClickedEventListener = (listener: (adInfo: AdInfo) => void) => {
|
|
56
|
-
addEventListener(ON_APPOPEN_AD_CLICKED_EVENT,
|
|
55
|
+
const addAdClickedEventListener = (listener: (adInfo: AdInfo) => void): void => {
|
|
56
|
+
addEventListener(ON_APPOPEN_AD_CLICKED_EVENT, listener);
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
const removeAdClickedEventListener = () => {
|
|
59
|
+
const removeAdClickedEventListener = (): void => {
|
|
60
60
|
removeEventListener(ON_APPOPEN_AD_CLICKED_EVENT);
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
const addAdDisplayedEventListener = (listener: (adInfo: AdInfo) => void) => {
|
|
64
|
-
addEventListener(ON_APPOPEN_AD_DISPLAYED_EVENT,
|
|
63
|
+
const addAdDisplayedEventListener = (listener: (adInfo: AdInfo) => void): void => {
|
|
64
|
+
addEventListener(ON_APPOPEN_AD_DISPLAYED_EVENT, listener);
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
const removeAdDisplayedEventListener = () => {
|
|
67
|
+
const removeAdDisplayedEventListener = (): void => {
|
|
68
68
|
removeEventListener(ON_APPOPEN_AD_DISPLAYED_EVENT);
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
const addAdFailedToDisplayEventListener = (listener: (errorInfo: AdDisplayFailedInfo) => void) => {
|
|
72
|
-
addEventListener(ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT,
|
|
71
|
+
const addAdFailedToDisplayEventListener = (listener: (errorInfo: AdDisplayFailedInfo) => void): void => {
|
|
72
|
+
addEventListener(ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT, listener);
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
const removeAdFailedToDisplayEventListener = () => {
|
|
75
|
+
const removeAdFailedToDisplayEventListener = (): void => {
|
|
76
76
|
removeEventListener(ON_APPOPEN_AD_FAILED_TO_DISPLAY_EVENT);
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
const addAdHiddenEventListener = (listener: (adInfo: AdInfo) => void) => {
|
|
80
|
-
addEventListener(ON_APPOPEN_AD_HIDDEN_EVENT,
|
|
79
|
+
const addAdHiddenEventListener = (listener: (adInfo: AdInfo) => void): void => {
|
|
80
|
+
addEventListener(ON_APPOPEN_AD_HIDDEN_EVENT, listener);
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
const removeAdHiddenEventListener = () => {
|
|
83
|
+
const removeAdHiddenEventListener = (): void => {
|
|
84
84
|
removeEventListener(ON_APPOPEN_AD_HIDDEN_EVENT);
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
const addAdRevenuePaidListener = (listener: (adInfo: AdRevenueInfo) => void) => {
|
|
88
|
-
addEventListener(ON_APPOPEN_AD_REVENUE_PAID,
|
|
87
|
+
const addAdRevenuePaidListener = (listener: (adInfo: AdRevenueInfo) => void): void => {
|
|
88
|
+
addEventListener(ON_APPOPEN_AD_REVENUE_PAID, listener);
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
const removeAdRevenuePaidListener = () => {
|
|
91
|
+
const removeAdRevenuePaidListener = (): void => {
|
|
92
92
|
removeEventListener(ON_APPOPEN_AD_REVENUE_PAID);
|
|
93
93
|
};
|
|
94
94
|
|