react-native-google-mobile-ads 5.0.1 → 6.0.0
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/RNGoogleMobileAds.podspec +1 -1
- package/__tests__/interstitial.test.ts +32 -5
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsAppOpenModule.java +2 -1
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsBannerAdViewManager.java +110 -68
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsCommon.java +5 -11
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsConsentModule.java +19 -5
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsEvent.java +1 -0
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsInterstitialModule.java +38 -20
- package/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsModule.java +45 -0
- package/docs/ad-inspector.mdx +39 -0
- package/docs/common-reasons-for-ads-not-showing.mdx +26 -24
- package/docs/displaying-ads-hook.mdx +99 -0
- package/docs/displaying-ads.mdx +49 -29
- package/docs/european-user-consent.mdx +34 -5
- package/docs/index.mdx +4 -4
- package/docs/migrating-to-v5.mdx +17 -8
- package/docs/migrating-to-v6.mdx +111 -0
- package/docs.json +5 -2
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsAppOpenModule.m +1 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsBannerViewManager.m +63 -8
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsCommon.h +3 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsCommon.m +8 -7
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsConsentModule.m +14 -0
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.h +2 -1
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsFullScreenContentDelegate.m +17 -2
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsInterstitialModule.m +44 -30
- package/ios/RNGoogleMobileAds/RNGoogleMobileAdsModule.m +19 -0
- package/lib/commonjs/AdEventType.js.map +1 -1
- package/lib/commonjs/AdsConsent.js +47 -16
- package/lib/commonjs/AdsConsent.js.map +1 -1
- package/lib/commonjs/AdsConsentPurposes.js +47 -0
- package/lib/commonjs/AdsConsentPurposes.js.map +1 -0
- package/lib/commonjs/AdsConsentSpecialFeatures.js +39 -0
- package/lib/commonjs/AdsConsentSpecialFeatures.js.map +1 -0
- package/lib/commonjs/GAMAdEventType.js +30 -0
- package/lib/commonjs/GAMAdEventType.js.map +1 -0
- package/lib/commonjs/MobileAds.js +4 -0
- package/lib/commonjs/MobileAds.js.map +1 -1
- package/lib/commonjs/RewardedAdEventType.js.map +1 -1
- package/lib/commonjs/TestIds.js +5 -0
- package/lib/commonjs/TestIds.js.map +1 -1
- package/lib/commonjs/ads/AppOpenAd.js +8 -53
- package/lib/commonjs/ads/AppOpenAd.js.map +1 -1
- package/lib/commonjs/ads/BannerAd.js +7 -110
- package/lib/commonjs/ads/BannerAd.js.map +1 -1
- package/lib/commonjs/ads/BaseAd.js +144 -0
- package/lib/commonjs/ads/BaseAd.js.map +1 -0
- package/lib/commonjs/ads/GAMBannerAd.js +42 -0
- package/lib/commonjs/ads/GAMBannerAd.js.map +1 -0
- package/lib/commonjs/ads/GAMInterstitialAd.js +48 -0
- package/lib/commonjs/ads/GAMInterstitialAd.js.map +1 -0
- package/lib/commonjs/ads/InterstitialAd.js +13 -64
- package/lib/commonjs/ads/InterstitialAd.js.map +1 -1
- package/lib/commonjs/ads/MobileAd.js +119 -12
- package/lib/commonjs/ads/MobileAd.js.map +1 -1
- package/lib/commonjs/ads/RewardedAd.js +23 -65
- package/lib/commonjs/ads/RewardedAd.js.map +1 -1
- package/lib/commonjs/hooks/useAppOpenAd.js +51 -0
- package/lib/commonjs/hooks/useAppOpenAd.js.map +1 -0
- package/lib/commonjs/hooks/useFullScreenAd.js +125 -0
- package/lib/commonjs/hooks/useFullScreenAd.js.map +1 -0
- package/lib/commonjs/hooks/useInterstitialAd.js +51 -0
- package/lib/commonjs/hooks/useInterstitialAd.js.map +1 -0
- package/lib/commonjs/hooks/useRewardedAd.js +51 -0
- package/lib/commonjs/hooks/useRewardedAd.js.map +1 -0
- package/lib/commonjs/index.js +102 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types/AdEventsListener.js +6 -0
- package/lib/commonjs/types/AdEventsListener.js.map +1 -0
- package/lib/commonjs/types/AdStates.js +6 -0
- package/lib/commonjs/types/AdStates.js.map +1 -0
- package/lib/commonjs/types/AppEvent.js +2 -0
- package/lib/commonjs/types/AppEvent.js.map +1 -0
- package/lib/commonjs/types/index.js +149 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/validateAdRequestOptions.js +0 -38
- package/lib/commonjs/validateAdRequestOptions.js.map +1 -1
- package/lib/commonjs/version.js +2 -2
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/AdEventType.js.map +1 -1
- package/lib/module/AdsConsent.js +44 -16
- package/lib/module/AdsConsent.js.map +1 -1
- package/lib/module/AdsConsentPurposes.js +39 -0
- package/lib/module/AdsConsentPurposes.js.map +1 -0
- package/lib/module/AdsConsentSpecialFeatures.js +31 -0
- package/lib/module/AdsConsentSpecialFeatures.js.map +1 -0
- package/lib/module/GAMAdEventType.js +22 -0
- package/lib/module/GAMAdEventType.js.map +1 -0
- package/lib/module/MobileAds.js +4 -0
- package/lib/module/MobileAds.js.map +1 -1
- package/lib/module/RewardedAdEventType.js.map +1 -1
- package/lib/module/TestIds.js +5 -0
- package/lib/module/TestIds.js.map +1 -1
- package/lib/module/ads/AppOpenAd.js +10 -37
- package/lib/module/ads/AppOpenAd.js.map +1 -1
- package/lib/module/ads/BannerAd.js +7 -85
- package/lib/module/ads/BannerAd.js.map +1 -1
- package/lib/module/ads/BaseAd.js +124 -0
- package/lib/module/ads/BaseAd.js.map +1 -0
- package/lib/module/ads/GAMBannerAd.js +42 -0
- package/lib/module/ads/GAMBannerAd.js.map +1 -0
- package/lib/module/ads/GAMInterstitialAd.js +38 -0
- package/lib/module/ads/GAMInterstitialAd.js.map +1 -0
- package/lib/module/ads/InterstitialAd.js +15 -48
- package/lib/module/ads/InterstitialAd.js.map +1 -1
- package/lib/module/ads/MobileAd.js +116 -12
- package/lib/module/ads/MobileAd.js.map +1 -1
- package/lib/module/ads/RewardedAd.js +24 -49
- package/lib/module/ads/RewardedAd.js.map +1 -1
- package/lib/module/hooks/useAppOpenAd.js +38 -0
- package/lib/module/hooks/useAppOpenAd.js.map +1 -0
- package/lib/module/hooks/useFullScreenAd.js +114 -0
- package/lib/module/hooks/useFullScreenAd.js.map +1 -0
- package/lib/module/hooks/useInterstitialAd.js +38 -0
- package/lib/module/hooks/useInterstitialAd.js.map +1 -0
- package/lib/module/hooks/useRewardedAd.js +38 -0
- package/lib/module/hooks/useRewardedAd.js.map +1 -0
- package/lib/module/index.js +9 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/AdEventsListener.js +2 -0
- package/lib/module/types/AdEventsListener.js.map +1 -0
- package/lib/module/types/AdStates.js +2 -0
- package/lib/module/types/AdStates.js.map +1 -0
- package/lib/module/types/AppEvent.js +2 -0
- package/lib/module/types/AppEvent.js.map +1 -0
- package/lib/module/types/index.js +28 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/validateAdRequestOptions.js +1 -39
- package/lib/module/validateAdRequestOptions.js.map +1 -1
- package/lib/module/version.js +2 -2
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/AdEventType.d.ts +4 -8
- package/lib/typescript/AdsConsentPurposes.d.ts +148 -0
- package/lib/typescript/AdsConsentSpecialFeatures.d.ts +22 -0
- package/lib/typescript/GAMAdEventType.d.ts +20 -0
- package/lib/typescript/MobileAds.d.ts +2 -1
- package/lib/typescript/RewardedAdEventType.d.ts +7 -11
- package/lib/typescript/TestIds.d.ts +5 -0
- package/lib/typescript/ads/AppOpenAd.d.ts +6 -6
- package/lib/typescript/ads/BannerAd.d.ts +1 -1
- package/lib/typescript/ads/BaseAd.d.ts +35 -0
- package/lib/typescript/ads/GAMBannerAd.d.ts +7 -0
- package/lib/typescript/ads/GAMInterstitialAd.d.ts +33 -0
- package/lib/typescript/ads/InterstitialAd.d.ts +10 -16
- package/lib/typescript/ads/MobileAd.d.ts +34 -16
- package/lib/typescript/ads/RewardedAd.d.ts +17 -19
- package/lib/typescript/hooks/useAppOpenAd.d.ts +9 -0
- package/lib/typescript/hooks/useFullScreenAd.d.ts +5 -0
- package/lib/typescript/hooks/useInterstitialAd.d.ts +9 -0
- package/lib/typescript/hooks/useRewardedAd.d.ts +9 -0
- package/lib/typescript/index.d.ts +10 -1
- package/lib/typescript/types/AdEventListener.d.ts +5 -9
- package/lib/typescript/types/AdEventsListener.d.ts +8 -0
- package/lib/typescript/types/AdStates.d.ts +85 -0
- package/lib/typescript/types/AdsConsent.interface.d.ts +216 -0
- package/lib/typescript/types/AppEvent.d.ts +13 -0
- package/lib/typescript/types/BannerAdProps.d.ts +81 -4
- package/lib/typescript/types/GoogleMobileAdsNativeModule.d.ts +3 -2
- package/lib/typescript/types/MobileAd.interface.d.ts +37 -12
- package/lib/typescript/types/MobileAdsModule.interface.d.ts +9 -0
- package/lib/typescript/types/RequestOptions.d.ts +0 -22
- package/lib/typescript/types/index.d.ts +11 -0
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +55 -50
- package/src/AdEventType.ts +4 -8
- package/src/AdsConsent.ts +75 -20
- package/src/AdsConsentPurposes.ts +182 -0
- package/src/AdsConsentSpecialFeatures.ts +48 -0
- package/src/GAMAdEventType.ts +37 -0
- package/src/MobileAds.ts +4 -0
- package/src/RewardedAdEventType.ts +7 -11
- package/src/TestIds.ts +5 -0
- package/src/ads/AppOpenAd.ts +11 -41
- package/src/ads/BannerAd.tsx +4 -106
- package/src/ads/BaseAd.tsx +156 -0
- package/src/ads/GAMBannerAd.tsx +37 -0
- package/src/ads/GAMInterstitialAd.ts +45 -0
- package/src/ads/InterstitialAd.ts +15 -56
- package/src/ads/MobileAd.ts +142 -29
- package/src/ads/RewardedAd.ts +29 -55
- package/src/hooks/useAppOpenAd.ts +46 -0
- package/src/hooks/useFullScreenAd.ts +105 -0
- package/src/hooks/useInterstitialAd.ts +46 -0
- package/src/hooks/useRewardedAd.ts +46 -0
- package/src/index.ts +9 -0
- package/src/types/AdEventListener.ts +31 -13
- package/src/types/AdEventsListener.ts +24 -0
- package/src/types/AdStates.ts +87 -0
- package/src/types/AdsConsent.interface.ts +220 -0
- package/src/types/AppEvent.ts +14 -0
- package/src/types/BannerAdProps.ts +81 -4
- package/src/types/GoogleMobileAdsNativeModule.ts +3 -2
- package/src/types/MobileAd.interface.ts +56 -12
- package/src/types/MobileAdsModule.interface.ts +10 -0
- package/src/types/RequestOptions.ts +0 -24
- package/src/types/index.ts +28 -0
- package/src/validateAdRequestOptions.ts +0 -45
- package/src/version.ts +2 -2
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useAppOpenAd = useAppOpenAd;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _useDeepCompareEffect = _interopRequireDefault(require("use-deep-compare-effect"));
|
|
11
|
+
|
|
12
|
+
var _AppOpenAd = require("../ads/AppOpenAd");
|
|
13
|
+
|
|
14
|
+
var _useFullScreenAd = require("./useFullScreenAd");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
20
|
+
*
|
|
21
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this library except in compliance with the License.
|
|
23
|
+
* You may obtain a copy of the License at
|
|
24
|
+
*
|
|
25
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
28
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
29
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
30
|
+
* See the License for the specific language governing permissions and
|
|
31
|
+
* limitations under the License.
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* React Hook for App Open Ad.
|
|
37
|
+
*
|
|
38
|
+
* @param adUnitId The Ad Unit ID for the App Open Ad. You can find this on your Google Mobile Ads dashboard. You can destroy ad instance by setting this value to null.
|
|
39
|
+
* @param requestOptions Optional RequestOptions used to load the ad.
|
|
40
|
+
*/
|
|
41
|
+
function useAppOpenAd(adUnitId) {
|
|
42
|
+
let requestOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
43
|
+
const [appOpenAd, setAppOpenAd] = (0, _react.useState)(null);
|
|
44
|
+
(0, _useDeepCompareEffect.default)(() => {
|
|
45
|
+
setAppOpenAd(() => {
|
|
46
|
+
return adUnitId ? _AppOpenAd.AppOpenAd.createForAdRequest(adUnitId, requestOptions) : null;
|
|
47
|
+
});
|
|
48
|
+
}, [adUnitId, requestOptions]);
|
|
49
|
+
return (0, _useFullScreenAd.useFullScreenAd)(appOpenAd);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=useAppOpenAd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAppOpenAd.ts"],"names":["useAppOpenAd","adUnitId","requestOptions","appOpenAd","setAppOpenAd","AppOpenAd","createForAdRequest"],"mappings":";;;;;;;AAiBA;;AACA;;AAEA;;AAIA;;;;AAxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,YAAT,CACLC,QADK,EAG6C;AAAA,MADlDC,cACkD,uEADjB,EACiB;AAClD,QAAM,CAACC,SAAD,EAAYC,YAAZ,IAA4B,qBAA2B,IAA3B,CAAlC;AAEA,qCAAqB,MAAM;AACzBA,IAAAA,YAAY,CAAC,MAAM;AACjB,aAAOH,QAAQ,GAAGI,qBAAUC,kBAAV,CAA6BL,QAA7B,EAAuCC,cAAvC,CAAH,GAA4D,IAA3E;AACD,KAFW,CAAZ;AAGD,GAJD,EAIG,CAACD,QAAD,EAAWC,cAAX,CAJH;AAMA,SAAO,sCAAgBC,SAAhB,CAAP;AACD","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { useState } from 'react';\nimport useDeepCompareEffect from 'use-deep-compare-effect';\n\nimport { AppOpenAd } from '../ads/AppOpenAd';\nimport { AdHookReturns } from '../types/AdStates';\nimport { RequestOptions } from '../types/RequestOptions';\n\nimport { useFullScreenAd } from './useFullScreenAd';\n\n/**\n * React Hook for App Open Ad.\n *\n * @param adUnitId The Ad Unit ID for the App Open Ad. You can find this on your Google Mobile Ads dashboard. You can destroy ad instance by setting this value to null.\n * @param requestOptions Optional RequestOptions used to load the ad.\n */\nexport function useAppOpenAd(\n adUnitId: string | null,\n requestOptions: RequestOptions = {},\n): Omit<AdHookReturns, 'reward' | 'isEarnedReward'> {\n const [appOpenAd, setAppOpenAd] = useState<AppOpenAd | null>(null);\n\n useDeepCompareEffect(() => {\n setAppOpenAd(() => {\n return adUnitId ? AppOpenAd.createForAdRequest(adUnitId, requestOptions) : null;\n });\n }, [adUnitId, requestOptions]);\n\n return useFullScreenAd(appOpenAd);\n}\n"]}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFullScreenAd = useFullScreenAd;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _AdEventType = require("../AdEventType");
|
|
11
|
+
|
|
12
|
+
var _RewardedAdEventType = require("../RewardedAdEventType");
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
16
|
+
*
|
|
17
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this library except in compliance with the License.
|
|
19
|
+
* You may obtain a copy of the License at
|
|
20
|
+
*
|
|
21
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
* See the License for the specific language governing permissions and
|
|
27
|
+
* limitations under the License.
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
const initialState = {
|
|
31
|
+
isLoaded: false,
|
|
32
|
+
isOpened: false,
|
|
33
|
+
isClicked: false,
|
|
34
|
+
isClosed: false,
|
|
35
|
+
error: undefined,
|
|
36
|
+
reward: undefined,
|
|
37
|
+
isEarnedReward: false
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function useFullScreenAd(ad) {
|
|
41
|
+
const [state, setState] = (0, _react.useReducer)((prevState, newState) => ({ ...prevState,
|
|
42
|
+
...newState
|
|
43
|
+
}), initialState);
|
|
44
|
+
const isShowing = state.isOpened && !state.isClosed;
|
|
45
|
+
const load = (0, _react.useCallback)(() => {
|
|
46
|
+
if (ad) {
|
|
47
|
+
setState(initialState);
|
|
48
|
+
ad.load();
|
|
49
|
+
}
|
|
50
|
+
}, [ad]);
|
|
51
|
+
const show = (0, _react.useCallback)(showOptions => {
|
|
52
|
+
if (ad) {
|
|
53
|
+
ad.show(showOptions);
|
|
54
|
+
}
|
|
55
|
+
}, [ad]);
|
|
56
|
+
(0, _react.useEffect)(() => {
|
|
57
|
+
setState(initialState);
|
|
58
|
+
|
|
59
|
+
if (!ad) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const unsubscribe = ad.addAdEventsListener(_ref => {
|
|
64
|
+
let {
|
|
65
|
+
type,
|
|
66
|
+
payload
|
|
67
|
+
} = _ref;
|
|
68
|
+
|
|
69
|
+
switch (type) {
|
|
70
|
+
case _AdEventType.AdEventType.LOADED:
|
|
71
|
+
setState({
|
|
72
|
+
isLoaded: true
|
|
73
|
+
});
|
|
74
|
+
break;
|
|
75
|
+
|
|
76
|
+
case _AdEventType.AdEventType.OPENED:
|
|
77
|
+
setState({
|
|
78
|
+
isOpened: true
|
|
79
|
+
});
|
|
80
|
+
break;
|
|
81
|
+
|
|
82
|
+
case _AdEventType.AdEventType.CLOSED:
|
|
83
|
+
setState({
|
|
84
|
+
isClosed: true
|
|
85
|
+
});
|
|
86
|
+
break;
|
|
87
|
+
|
|
88
|
+
case _AdEventType.AdEventType.CLICKED:
|
|
89
|
+
setState({
|
|
90
|
+
isClicked: true
|
|
91
|
+
});
|
|
92
|
+
break;
|
|
93
|
+
|
|
94
|
+
case _AdEventType.AdEventType.ERROR:
|
|
95
|
+
setState({
|
|
96
|
+
error: payload
|
|
97
|
+
});
|
|
98
|
+
break;
|
|
99
|
+
|
|
100
|
+
case _RewardedAdEventType.RewardedAdEventType.LOADED:
|
|
101
|
+
setState({
|
|
102
|
+
isLoaded: true,
|
|
103
|
+
reward: payload
|
|
104
|
+
});
|
|
105
|
+
break;
|
|
106
|
+
|
|
107
|
+
case _RewardedAdEventType.RewardedAdEventType.EARNED_REWARD:
|
|
108
|
+
setState({
|
|
109
|
+
isEarnedReward: true,
|
|
110
|
+
reward: payload
|
|
111
|
+
});
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return () => {
|
|
116
|
+
unsubscribe();
|
|
117
|
+
};
|
|
118
|
+
}, [ad]);
|
|
119
|
+
return { ...state,
|
|
120
|
+
isShowing,
|
|
121
|
+
load,
|
|
122
|
+
show
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=useFullScreenAd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useFullScreenAd.ts"],"names":["initialState","isLoaded","isOpened","isClicked","isClosed","error","undefined","reward","isEarnedReward","useFullScreenAd","ad","state","setState","prevState","newState","isShowing","load","show","showOptions","unsubscribe","addAdEventsListener","type","payload","AdEventType","LOADED","OPENED","CLOSED","CLICKED","ERROR","RewardedAdEventType","EARNED_REWARD"],"mappings":";;;;;;;AAiBA;;AAEA;;AAIA;;AAvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaA,MAAMA,YAAsB,GAAG;AAC7BC,EAAAA,QAAQ,EAAE,KADmB;AAE7BC,EAAAA,QAAQ,EAAE,KAFmB;AAG7BC,EAAAA,SAAS,EAAE,KAHkB;AAI7BC,EAAAA,QAAQ,EAAE,KAJmB;AAK7BC,EAAAA,KAAK,EAAEC,SALsB;AAM7BC,EAAAA,MAAM,EAAED,SANqB;AAO7BE,EAAAA,cAAc,EAAE;AAPa,CAA/B;;AAUO,SAASC,eAAT,CACLC,EADK,EAEU;AACf,QAAM,CAACC,KAAD,EAAQC,QAAR,IAAoB,uBACxB,CAACC,SAAD,EAAYC,QAAZ,MAA0B,EAAE,GAAGD,SAAL;AAAgB,OAAGC;AAAnB,GAA1B,CADwB,EAExBd,YAFwB,CAA1B;AAIA,QAAMe,SAAS,GAAGJ,KAAK,CAACT,QAAN,IAAkB,CAACS,KAAK,CAACP,QAA3C;AAEA,QAAMY,IAAI,GAAG,wBAAY,MAAM;AAC7B,QAAIN,EAAJ,EAAQ;AACNE,MAAAA,QAAQ,CAACZ,YAAD,CAAR;AACAU,MAAAA,EAAE,CAACM,IAAH;AACD;AACF,GALY,EAKV,CAACN,EAAD,CALU,CAAb;AAOA,QAAMO,IAAI,GAAG,wBACVC,WAAD,IAAiC;AAC/B,QAAIR,EAAJ,EAAQ;AACNA,MAAAA,EAAE,CAACO,IAAH,CAAQC,WAAR;AACD;AACF,GALU,EAMX,CAACR,EAAD,CANW,CAAb;AASA,wBAAU,MAAM;AACdE,IAAAA,QAAQ,CAACZ,YAAD,CAAR;;AACA,QAAI,CAACU,EAAL,EAAS;AACP;AACD;;AACD,UAAMS,WAAW,GAAIT,EAAD,CAAmBU,mBAAnB,CAAuC,QAAuB;AAAA,UAAtB;AAAEC,QAAAA,IAAF;AAAQC,QAAAA;AAAR,OAAsB;;AAChF,cAAQD,IAAR;AACE,aAAKE,yBAAYC,MAAjB;AACEZ,UAAAA,QAAQ,CAAC;AAAEX,YAAAA,QAAQ,EAAE;AAAZ,WAAD,CAAR;AACA;;AACF,aAAKsB,yBAAYE,MAAjB;AACEb,UAAAA,QAAQ,CAAC;AAAEV,YAAAA,QAAQ,EAAE;AAAZ,WAAD,CAAR;AACA;;AACF,aAAKqB,yBAAYG,MAAjB;AACEd,UAAAA,QAAQ,CAAC;AAAER,YAAAA,QAAQ,EAAE;AAAZ,WAAD,CAAR;AACA;;AACF,aAAKmB,yBAAYI,OAAjB;AACEf,UAAAA,QAAQ,CAAC;AAAET,YAAAA,SAAS,EAAE;AAAb,WAAD,CAAR;AACA;;AACF,aAAKoB,yBAAYK,KAAjB;AACEhB,UAAAA,QAAQ,CAAC;AAAEP,YAAAA,KAAK,EAAEiB;AAAT,WAAD,CAAR;AACA;;AACF,aAAKO,yCAAoBL,MAAzB;AACEZ,UAAAA,QAAQ,CAAC;AAAEX,YAAAA,QAAQ,EAAE,IAAZ;AAAkBM,YAAAA,MAAM,EAAEe;AAA1B,WAAD,CAAR;AACA;;AACF,aAAKO,yCAAoBC,aAAzB;AACElB,UAAAA,QAAQ,CAAC;AAAEJ,YAAAA,cAAc,EAAE,IAAlB;AAAwBD,YAAAA,MAAM,EAAEe;AAAhC,WAAD,CAAR;AACA;AArBJ;AAuBD,KAxBmB,CAApB;AAyBA,WAAO,MAAM;AACXH,MAAAA,WAAW;AACZ,KAFD;AAGD,GAjCD,EAiCG,CAACT,EAAD,CAjCH;AAmCA,SAAO,EACL,GAAGC,KADE;AAELI,IAAAA,SAFK;AAGLC,IAAAA,IAHK;AAILC,IAAAA;AAJK,GAAP;AAMD","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { Reducer, useCallback, useEffect, useReducer } from 'react';\n\nimport { AdEventType } from '../AdEventType';\nimport { AppOpenAd } from '../ads/AppOpenAd';\nimport { InterstitialAd } from '../ads/InterstitialAd';\nimport { RewardedAd } from '../ads/RewardedAd';\nimport { RewardedAdEventType } from '../RewardedAdEventType';\nimport { AdStates, AdHookReturns } from '../types/AdStates';\nimport { AdShowOptions } from '../types/AdShowOptions';\nimport { RewardedAdReward } from '../types/RewardedAdReward';\n\nconst initialState: AdStates = {\n isLoaded: false,\n isOpened: false,\n isClicked: false,\n isClosed: false,\n error: undefined,\n reward: undefined,\n isEarnedReward: false,\n};\n\nexport function useFullScreenAd<T extends InterstitialAd | RewardedAd | AppOpenAd | null>(\n ad: T,\n): AdHookReturns {\n const [state, setState] = useReducer<Reducer<AdStates, Partial<AdStates>>>(\n (prevState, newState) => ({ ...prevState, ...newState }),\n initialState,\n );\n const isShowing = state.isOpened && !state.isClosed;\n\n const load = useCallback(() => {\n if (ad) {\n setState(initialState);\n ad.load();\n }\n }, [ad]);\n\n const show = useCallback(\n (showOptions?: AdShowOptions) => {\n if (ad) {\n ad.show(showOptions);\n }\n },\n [ad],\n );\n\n useEffect(() => {\n setState(initialState);\n if (!ad) {\n return;\n }\n const unsubscribe = (ad as RewardedAd).addAdEventsListener(({ type, payload }) => {\n switch (type) {\n case AdEventType.LOADED:\n setState({ isLoaded: true });\n break;\n case AdEventType.OPENED:\n setState({ isOpened: true });\n break;\n case AdEventType.CLOSED:\n setState({ isClosed: true });\n break;\n case AdEventType.CLICKED:\n setState({ isClicked: true });\n break;\n case AdEventType.ERROR:\n setState({ error: payload as Error });\n break;\n case RewardedAdEventType.LOADED:\n setState({ isLoaded: true, reward: payload as RewardedAdReward });\n break;\n case RewardedAdEventType.EARNED_REWARD:\n setState({ isEarnedReward: true, reward: payload as RewardedAdReward });\n break;\n }\n });\n return () => {\n unsubscribe();\n };\n }, [ad]);\n\n return {\n ...state,\n isShowing,\n load,\n show,\n };\n}\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useInterstitialAd = useInterstitialAd;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _useDeepCompareEffect = _interopRequireDefault(require("use-deep-compare-effect"));
|
|
11
|
+
|
|
12
|
+
var _InterstitialAd = require("../ads/InterstitialAd");
|
|
13
|
+
|
|
14
|
+
var _useFullScreenAd = require("./useFullScreenAd");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
20
|
+
*
|
|
21
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this library except in compliance with the License.
|
|
23
|
+
* You may obtain a copy of the License at
|
|
24
|
+
*
|
|
25
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
28
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
29
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
30
|
+
* See the License for the specific language governing permissions and
|
|
31
|
+
* limitations under the License.
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* React Hook for Interstitial Ad.
|
|
37
|
+
*
|
|
38
|
+
* @param adUnitId The Ad Unit ID for the Interstitial Ad. You can find this on your Google Mobile Ads dashboard. You can destroy ad instance by setting this value to null.
|
|
39
|
+
* @param requestOptions Optional RequestOptions used to load the ad.
|
|
40
|
+
*/
|
|
41
|
+
function useInterstitialAd(adUnitId) {
|
|
42
|
+
let requestOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
43
|
+
const [interstitialAd, setInterstitialAd] = (0, _react.useState)(null);
|
|
44
|
+
(0, _useDeepCompareEffect.default)(() => {
|
|
45
|
+
setInterstitialAd(() => {
|
|
46
|
+
return adUnitId ? _InterstitialAd.InterstitialAd.createForAdRequest(adUnitId, requestOptions) : null;
|
|
47
|
+
});
|
|
48
|
+
}, [adUnitId, requestOptions]);
|
|
49
|
+
return (0, _useFullScreenAd.useFullScreenAd)(interstitialAd);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=useInterstitialAd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useInterstitialAd.ts"],"names":["useInterstitialAd","adUnitId","requestOptions","interstitialAd","setInterstitialAd","InterstitialAd","createForAdRequest"],"mappings":";;;;;;;AAiBA;;AACA;;AAEA;;AAIA;;;;AAxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,iBAAT,CACLC,QADK,EAG6C;AAAA,MADlDC,cACkD,uEADjB,EACiB;AAClD,QAAM,CAACC,cAAD,EAAiBC,iBAAjB,IAAsC,qBAAgC,IAAhC,CAA5C;AAEA,qCAAqB,MAAM;AACzBA,IAAAA,iBAAiB,CAAC,MAAM;AACtB,aAAOH,QAAQ,GAAGI,+BAAeC,kBAAf,CAAkCL,QAAlC,EAA4CC,cAA5C,CAAH,GAAiE,IAAhF;AACD,KAFgB,CAAjB;AAGD,GAJD,EAIG,CAACD,QAAD,EAAWC,cAAX,CAJH;AAMA,SAAO,sCAAgBC,cAAhB,CAAP;AACD","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { useState } from 'react';\nimport useDeepCompareEffect from 'use-deep-compare-effect';\n\nimport { InterstitialAd } from '../ads/InterstitialAd';\nimport { AdHookReturns } from '../types/AdStates';\nimport { RequestOptions } from '../types/RequestOptions';\n\nimport { useFullScreenAd } from './useFullScreenAd';\n\n/**\n * React Hook for Interstitial Ad.\n *\n * @param adUnitId The Ad Unit ID for the Interstitial Ad. You can find this on your Google Mobile Ads dashboard. You can destroy ad instance by setting this value to null.\n * @param requestOptions Optional RequestOptions used to load the ad.\n */\nexport function useInterstitialAd(\n adUnitId: string | null,\n requestOptions: RequestOptions = {},\n): Omit<AdHookReturns, 'reward' | 'isEarnedReward'> {\n const [interstitialAd, setInterstitialAd] = useState<InterstitialAd | null>(null);\n\n useDeepCompareEffect(() => {\n setInterstitialAd(() => {\n return adUnitId ? InterstitialAd.createForAdRequest(adUnitId, requestOptions) : null;\n });\n }, [adUnitId, requestOptions]);\n\n return useFullScreenAd(interstitialAd);\n}\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useRewardedAd = useRewardedAd;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _useDeepCompareEffect = _interopRequireDefault(require("use-deep-compare-effect"));
|
|
11
|
+
|
|
12
|
+
var _RewardedAd = require("../ads/RewardedAd");
|
|
13
|
+
|
|
14
|
+
var _useFullScreenAd = require("./useFullScreenAd");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
20
|
+
*
|
|
21
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this library except in compliance with the License.
|
|
23
|
+
* You may obtain a copy of the License at
|
|
24
|
+
*
|
|
25
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
28
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
29
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
30
|
+
* See the License for the specific language governing permissions and
|
|
31
|
+
* limitations under the License.
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* React Hook for Rewarded Ad.
|
|
37
|
+
*
|
|
38
|
+
* @param adUnitId The Ad Unit ID for the Rewarded Ad. You can find this on your Google Mobile Ads dashboard. You can destroy ad instance by setting this value to null.
|
|
39
|
+
* @param requestOptions Optional RequestOptions used to load the ad.
|
|
40
|
+
*/
|
|
41
|
+
function useRewardedAd(adUnitId) {
|
|
42
|
+
let requestOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
43
|
+
const [rewardedAd, setRewardedAd] = (0, _react.useState)(null);
|
|
44
|
+
(0, _useDeepCompareEffect.default)(() => {
|
|
45
|
+
setRewardedAd(() => {
|
|
46
|
+
return adUnitId ? _RewardedAd.RewardedAd.createForAdRequest(adUnitId, requestOptions) : null;
|
|
47
|
+
});
|
|
48
|
+
}, [adUnitId, requestOptions]);
|
|
49
|
+
return (0, _useFullScreenAd.useFullScreenAd)(rewardedAd);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=useRewardedAd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useRewardedAd.ts"],"names":["useRewardedAd","adUnitId","requestOptions","rewardedAd","setRewardedAd","RewardedAd","createForAdRequest"],"mappings":";;;;;;;AAiBA;;AACA;;AAEA;;AAIA;;;;AAxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAT,CACLC,QADK,EAG4B;AAAA,MADjCC,cACiC,uEADA,EACA;AACjC,QAAM,CAACC,UAAD,EAAaC,aAAb,IAA8B,qBAA4B,IAA5B,CAApC;AAEA,qCAAqB,MAAM;AACzBA,IAAAA,aAAa,CAAC,MAAM;AAClB,aAAOH,QAAQ,GAAGI,uBAAWC,kBAAX,CAA8BL,QAA9B,EAAwCC,cAAxC,CAAH,GAA6D,IAA5E;AACD,KAFY,CAAb;AAGD,GAJD,EAIG,CAACD,QAAD,EAAWC,cAAX,CAJH;AAMA,SAAO,sCAAgBC,UAAhB,CAAP;AACD","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { useState } from 'react';\nimport useDeepCompareEffect from 'use-deep-compare-effect';\n\nimport { RewardedAd } from '../ads/RewardedAd';\nimport { AdHookReturns } from '../types/AdStates';\nimport { RequestOptions } from '../types/RequestOptions';\n\nimport { useFullScreenAd } from './useFullScreenAd';\n\n/**\n * React Hook for Rewarded Ad.\n *\n * @param adUnitId The Ad Unit ID for the Rewarded Ad. You can find this on your Google Mobile Ads dashboard. You can destroy ad instance by setting this value to null.\n * @param requestOptions Optional RequestOptions used to load the ad.\n */\nexport function useRewardedAd(\n adUnitId: string | null,\n requestOptions: RequestOptions = {},\n): Omit<AdHookReturns, 'adReward'> {\n const [rewardedAd, setRewardedAd] = useState<RewardedAd | null>(null);\n\n useDeepCompareEffect(() => {\n setRewardedAd(() => {\n return adUnitId ? RewardedAd.createForAdRequest(adUnitId, requestOptions) : null;\n });\n }, [adUnitId, requestOptions]);\n\n return useFullScreenAd(rewardedAd);\n}\n"]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
SDK_VERSION: true,
|
|
8
|
+
MobileAds: true,
|
|
9
|
+
AdsConsentDebugGeography: true,
|
|
10
|
+
AdsConsentPurposes: true,
|
|
11
|
+
AdsConsentSpecialFeatures: true,
|
|
12
|
+
AdsConsentStatus: true,
|
|
13
|
+
MaxAdContentRating: true,
|
|
14
|
+
TestIds: true,
|
|
15
|
+
AdEventType: true,
|
|
16
|
+
BannerAdSize: true,
|
|
17
|
+
GAMAdEventType: true,
|
|
18
|
+
RewardedAdEventType: true,
|
|
19
|
+
AdsConsent: true,
|
|
20
|
+
AppOpenAd: true,
|
|
21
|
+
InterstitialAd: true,
|
|
22
|
+
RewardedAd: true,
|
|
23
|
+
BannerAd: true,
|
|
24
|
+
GAMBannerAd: true,
|
|
25
|
+
GAMInterstitialAd: true,
|
|
26
|
+
useAppOpenAd: true,
|
|
27
|
+
useInterstitialAd: true,
|
|
28
|
+
useRewardedAd: true
|
|
29
|
+
};
|
|
6
30
|
Object.defineProperty(exports, "AdEventType", {
|
|
7
31
|
enumerable: true,
|
|
8
32
|
get: function () {
|
|
@@ -21,6 +45,18 @@ Object.defineProperty(exports, "AdsConsentDebugGeography", {
|
|
|
21
45
|
return _AdsConsentDebugGeography.AdsConsentDebugGeography;
|
|
22
46
|
}
|
|
23
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "AdsConsentPurposes", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _AdsConsentPurposes.AdsConsentPurposes;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "AdsConsentSpecialFeatures", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _AdsConsentSpecialFeatures.AdsConsentSpecialFeatures;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
24
60
|
Object.defineProperty(exports, "AdsConsentStatus", {
|
|
25
61
|
enumerable: true,
|
|
26
62
|
get: function () {
|
|
@@ -45,6 +81,24 @@ Object.defineProperty(exports, "BannerAdSize", {
|
|
|
45
81
|
return _BannerAdSize.BannerAdSize;
|
|
46
82
|
}
|
|
47
83
|
});
|
|
84
|
+
Object.defineProperty(exports, "GAMAdEventType", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _GAMAdEventType.GAMAdEventType;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "GAMBannerAd", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _GAMBannerAd.GAMBannerAd;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "GAMInterstitialAd", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _GAMInterstitialAd.GAMInterstitialAd;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
48
102
|
Object.defineProperty(exports, "InterstitialAd", {
|
|
49
103
|
enumerable: true,
|
|
50
104
|
get: function () {
|
|
@@ -88,6 +142,24 @@ Object.defineProperty(exports, "default", {
|
|
|
88
142
|
return _MobileAds.default;
|
|
89
143
|
}
|
|
90
144
|
});
|
|
145
|
+
Object.defineProperty(exports, "useAppOpenAd", {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function () {
|
|
148
|
+
return _useAppOpenAd.useAppOpenAd;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
Object.defineProperty(exports, "useInterstitialAd", {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
get: function () {
|
|
154
|
+
return _useInterstitialAd.useInterstitialAd;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
Object.defineProperty(exports, "useRewardedAd", {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function () {
|
|
160
|
+
return _useRewardedAd.useRewardedAd;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
91
163
|
|
|
92
164
|
var _version = require("./version");
|
|
93
165
|
|
|
@@ -95,6 +167,10 @@ var _MobileAds = _interopRequireWildcard(require("./MobileAds"));
|
|
|
95
167
|
|
|
96
168
|
var _AdsConsentDebugGeography = require("./AdsConsentDebugGeography");
|
|
97
169
|
|
|
170
|
+
var _AdsConsentPurposes = require("./AdsConsentPurposes");
|
|
171
|
+
|
|
172
|
+
var _AdsConsentSpecialFeatures = require("./AdsConsentSpecialFeatures");
|
|
173
|
+
|
|
98
174
|
var _AdsConsentStatus = require("./AdsConsentStatus");
|
|
99
175
|
|
|
100
176
|
var _MaxAdContentRating = require("./MaxAdContentRating");
|
|
@@ -105,6 +181,8 @@ var _AdEventType = require("./AdEventType");
|
|
|
105
181
|
|
|
106
182
|
var _BannerAdSize = require("./BannerAdSize");
|
|
107
183
|
|
|
184
|
+
var _GAMAdEventType = require("./GAMAdEventType");
|
|
185
|
+
|
|
108
186
|
var _RewardedAdEventType = require("./RewardedAdEventType");
|
|
109
187
|
|
|
110
188
|
var _AdsConsent = require("./AdsConsent");
|
|
@@ -117,6 +195,30 @@ var _RewardedAd = require("./ads/RewardedAd");
|
|
|
117
195
|
|
|
118
196
|
var _BannerAd = require("./ads/BannerAd");
|
|
119
197
|
|
|
198
|
+
var _GAMBannerAd = require("./ads/GAMBannerAd");
|
|
199
|
+
|
|
200
|
+
var _GAMInterstitialAd = require("./ads/GAMInterstitialAd");
|
|
201
|
+
|
|
202
|
+
var _useAppOpenAd = require("./hooks/useAppOpenAd");
|
|
203
|
+
|
|
204
|
+
var _useInterstitialAd = require("./hooks/useInterstitialAd");
|
|
205
|
+
|
|
206
|
+
var _useRewardedAd = require("./hooks/useRewardedAd");
|
|
207
|
+
|
|
208
|
+
var _types = require("./types");
|
|
209
|
+
|
|
210
|
+
Object.keys(_types).forEach(function (key) {
|
|
211
|
+
if (key === "default" || key === "__esModule") return;
|
|
212
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
213
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
214
|
+
Object.defineProperty(exports, key, {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
get: function () {
|
|
217
|
+
return _types[key];
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
|
|
120
222
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
121
223
|
|
|
122
224
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["SDK_VERSION","version"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["SDK_VERSION","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;AA3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACO,MAAMA,WAAW,GAAGC,gBAApB","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { version } from './version';\n\n// import { SDK_VERSION } from 'react-native-google-mobile-ads';\nexport const SDK_VERSION = version;\n\nexport { default, MobileAds } from './MobileAds';\nexport { AdsConsentDebugGeography } from './AdsConsentDebugGeography';\nexport { AdsConsentPurposes } from './AdsConsentPurposes';\nexport { AdsConsentSpecialFeatures } from './AdsConsentSpecialFeatures';\nexport { AdsConsentStatus } from './AdsConsentStatus';\nexport { MaxAdContentRating } from './MaxAdContentRating';\nexport { TestIds } from './TestIds';\nexport { AdEventType } from './AdEventType';\nexport { BannerAdSize } from './BannerAdSize';\nexport { GAMAdEventType } from './GAMAdEventType';\nexport { RewardedAdEventType } from './RewardedAdEventType';\nexport { AdsConsent } from './AdsConsent';\nexport { AppOpenAd } from './ads/AppOpenAd';\nexport { InterstitialAd } from './ads/InterstitialAd';\nexport { RewardedAd } from './ads/RewardedAd';\nexport { BannerAd } from './ads/BannerAd';\nexport { GAMBannerAd } from './ads/GAMBannerAd';\nexport { GAMInterstitialAd } from './ads/GAMInterstitialAd';\nexport { useAppOpenAd } from './hooks/useAppOpenAd';\nexport { useInterstitialAd } from './hooks/useInterstitialAd';\nexport { useRewardedAd } from './hooks/useRewardedAd';\nexport * from './types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _AdapterStatus = require("./AdapterStatus");
|
|
8
|
+
|
|
9
|
+
Object.keys(_AdapterStatus).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _AdapterStatus[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _AdapterStatus[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _AdEventListener = require("./AdEventListener");
|
|
21
|
+
|
|
22
|
+
Object.keys(_AdEventListener).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _AdEventListener[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _AdEventListener[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _AdEventsListener = require("./AdEventsListener");
|
|
34
|
+
|
|
35
|
+
Object.keys(_AdEventsListener).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _AdEventsListener[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _AdEventsListener[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
var _AdsConsent = require("./AdsConsent.interface");
|
|
47
|
+
|
|
48
|
+
Object.keys(_AdsConsent).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (key in exports && exports[key] === _AdsConsent[key]) return;
|
|
51
|
+
Object.defineProperty(exports, key, {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return _AdsConsent[key];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
var _AdShowOptions = require("./AdShowOptions");
|
|
60
|
+
|
|
61
|
+
Object.keys(_AdShowOptions).forEach(function (key) {
|
|
62
|
+
if (key === "default" || key === "__esModule") return;
|
|
63
|
+
if (key in exports && exports[key] === _AdShowOptions[key]) return;
|
|
64
|
+
Object.defineProperty(exports, key, {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () {
|
|
67
|
+
return _AdShowOptions[key];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
var _AdStates = require("./AdStates");
|
|
73
|
+
|
|
74
|
+
Object.keys(_AdStates).forEach(function (key) {
|
|
75
|
+
if (key === "default" || key === "__esModule") return;
|
|
76
|
+
if (key in exports && exports[key] === _AdStates[key]) return;
|
|
77
|
+
Object.defineProperty(exports, key, {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () {
|
|
80
|
+
return _AdStates[key];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
var _BannerAdProps = require("./BannerAdProps");
|
|
86
|
+
|
|
87
|
+
Object.keys(_BannerAdProps).forEach(function (key) {
|
|
88
|
+
if (key === "default" || key === "__esModule") return;
|
|
89
|
+
if (key in exports && exports[key] === _BannerAdProps[key]) return;
|
|
90
|
+
Object.defineProperty(exports, key, {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _BannerAdProps[key];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
var _RequestConfiguration = require("./RequestConfiguration");
|
|
99
|
+
|
|
100
|
+
Object.keys(_RequestConfiguration).forEach(function (key) {
|
|
101
|
+
if (key === "default" || key === "__esModule") return;
|
|
102
|
+
if (key in exports && exports[key] === _RequestConfiguration[key]) return;
|
|
103
|
+
Object.defineProperty(exports, key, {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
get: function () {
|
|
106
|
+
return _RequestConfiguration[key];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
var _RequestOptions = require("./RequestOptions");
|
|
112
|
+
|
|
113
|
+
Object.keys(_RequestOptions).forEach(function (key) {
|
|
114
|
+
if (key === "default" || key === "__esModule") return;
|
|
115
|
+
if (key in exports && exports[key] === _RequestOptions[key]) return;
|
|
116
|
+
Object.defineProperty(exports, key, {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: function () {
|
|
119
|
+
return _RequestOptions[key];
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
var _RewardedAdReward = require("./RewardedAdReward");
|
|
125
|
+
|
|
126
|
+
Object.keys(_RewardedAdReward).forEach(function (key) {
|
|
127
|
+
if (key === "default" || key === "__esModule") return;
|
|
128
|
+
if (key in exports && exports[key] === _RewardedAdReward[key]) return;
|
|
129
|
+
Object.defineProperty(exports, key, {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: function () {
|
|
132
|
+
return _RewardedAdReward[key];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
var _AppEvent = require("./AppEvent");
|
|
138
|
+
|
|
139
|
+
Object.keys(_AppEvent).forEach(function (key) {
|
|
140
|
+
if (key === "default" || key === "__esModule") return;
|
|
141
|
+
if (key in exports && exports[key] === _AppEvent[key]) return;
|
|
142
|
+
Object.defineProperty(exports, key, {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () {
|
|
145
|
+
return _AppEvent[key];
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;AAiBA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["/*\n * Copyright (c) 2016-present Invertase Limited & Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this library except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nexport * from './AdapterStatus';\nexport * from './AdEventListener';\nexport * from './AdEventsListener';\nexport * from './AdsConsent.interface';\nexport * from './AdShowOptions';\nexport * from './AdStates';\nexport * from './BannerAdProps';\nexport * from './RequestConfiguration';\nexport * from './RequestOptions';\nexport * from './RewardedAdReward';\nexport * from './AppEvent';\n"]}
|