@adadapted/react-native-sdk 3.3.0 → 3.4.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/android/bin/build.gradle +9 -8
- package/android/bin/gradle.properties +1 -1
- package/android/build.gradle +17 -80
- package/android/gradle.properties +2 -2
- package/android/src/main/java/com/adadaptedreactnativesdk/AdadaptedReactNativeSdkModule.kt +39 -54
- package/ios/AdadaptedReactNativeSdk.m +1 -1
- package/lib/commonjs/api/adadaptedApiRequests.js +3 -3
- package/lib/commonjs/api/adadaptedApiRequests.js.map +1 -1
- package/lib/commonjs/api/adadaptedApiRequests.mock.js.map +1 -1
- package/lib/commonjs/api/adadaptedApiTypes.js +5 -10
- package/lib/commonjs/api/adadaptedApiTypes.js.map +1 -1
- package/lib/commonjs/components/AdZone.js +68 -73
- package/lib/commonjs/components/AdZone.js.map +1 -1
- package/lib/commonjs/components/ReportAdButton.js +9 -7
- package/lib/commonjs/components/ReportAdButton.js.map +1 -1
- package/lib/commonjs/index.js +63 -67
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/util.js +1 -4
- package/lib/commonjs/util.js.map +1 -1
- package/lib/module/api/adadaptedApiRequests.js +2 -0
- package/lib/module/api/adadaptedApiRequests.js.map +1 -1
- package/lib/module/api/adadaptedApiRequests.mock.js +2 -0
- package/lib/module/api/adadaptedApiRequests.mock.js.map +1 -1
- package/lib/module/api/adadaptedApiTypes.js +16 -0
- package/lib/module/api/adadaptedApiTypes.js.map +1 -1
- package/lib/module/components/AdZone.js +62 -68
- package/lib/module/components/AdZone.js.map +1 -1
- package/lib/module/components/ReportAdButton.js +9 -5
- package/lib/module/components/ReportAdButton.js.map +1 -1
- package/lib/module/index.js +58 -56
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/util.js +5 -5
- package/lib/module/util.js.map +1 -1
- package/lib/typescript/src/api/adadaptedApiTypes.d.ts +4 -0
- package/lib/typescript/src/api/adadaptedApiTypes.d.ts.map +1 -1
- package/lib/typescript/src/components/AdZone.d.ts +7 -3
- package/lib/typescript/src/components/AdZone.d.ts.map +1 -1
- package/lib/typescript/src/components/ReportAdButton.d.ts +2 -2
- package/lib/typescript/src/components/ReportAdButton.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +11 -12
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +10 -14
- package/src/api/adadaptedApiTypes.ts +5 -0
- package/src/components/AdZone.tsx +58 -42
- package/src/components/ReportAdButton.tsx +1 -1
- package/src/index.tsx +87 -76
- package/lib/typescript/example/index.d.ts +0 -2
- package/lib/typescript/example/index.d.ts.map +0 -1
- package/lib/typescript/example/src/App.d.ts +0 -29
- package/lib/typescript/example/src/App.d.ts.map +0 -1
- package/lib/typescript/example/src/OffScreenAdZone.d.ts +0 -38
- package/lib/typescript/example/src/OffScreenAdZone.d.ts.map +0 -1
- package/lib/typescript/example/src/StandardAdZone.d.ts +0 -38
- package/lib/typescript/example/src/StandardAdZone.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -2
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/jest.setup.d.ts +0 -6
- package/lib/typescript/jest.setup.d.ts.map +0 -1
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.AdZone =
|
|
7
|
-
var
|
|
6
|
+
exports.AdZone = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var adadaptedApiRequests = _interopRequireWildcard(require("../api/adadaptedApiRequests"));
|
|
10
10
|
var _adadaptedApiTypes = require("../api/adadaptedApiTypes");
|
|
11
11
|
var _reactNativeWebview = require("react-native-webview");
|
|
12
12
|
var _util = require("../util");
|
|
13
13
|
var _ReportAdButton = require("./ReportAdButton");
|
|
14
|
-
|
|
15
|
-
function
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
17
|
/**
|
|
17
18
|
* Component for creating an {@link AdZone}.
|
|
18
19
|
* @module
|
|
@@ -41,67 +42,53 @@ let cycleAdTimer;
|
|
|
41
42
|
* @param props - properties passed to AdZone.
|
|
42
43
|
* @returns an AdZone JSX Element.
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
|
-
// Generates a random number between 0 and (number of available ads - 1).
|
|
46
|
-
const startingAdIndex = Math.floor(Math.random() * props.adZoneData.ads.length);
|
|
47
|
-
|
|
45
|
+
const AdZone = props => {
|
|
48
46
|
/**
|
|
49
47
|
* Tracks the current ad index being shown.
|
|
50
48
|
*/
|
|
51
|
-
const [adIndexShown, setAdIndexShown] = (0,
|
|
49
|
+
const [adIndexShown, setAdIndexShown] = (0, _react.useState)(Math.floor(Math.random() * props.adZoneData.ads.length));
|
|
52
50
|
/**
|
|
53
51
|
* Tracks the coordinates when the user started touching the Ad View.
|
|
54
52
|
*/
|
|
55
|
-
const [touchStartCoords, setTouchStartCoords] = (0,
|
|
53
|
+
const [touchStartCoords, setTouchStartCoords] = (0, _react.useState)({
|
|
56
54
|
x: 0,
|
|
57
55
|
y: 0
|
|
58
56
|
});
|
|
57
|
+
|
|
59
58
|
/**
|
|
60
59
|
* Track ad visibility (for off-screen ads).
|
|
61
60
|
*/
|
|
62
|
-
const [
|
|
61
|
+
const [isAdZoneVisible, setIsAdVisibile] = (0, _react.useState)(props.isAdZoneVisible);
|
|
63
62
|
|
|
64
63
|
// Setup device listeners.
|
|
65
|
-
(0,
|
|
64
|
+
(0, _react.useEffect)(() => {
|
|
66
65
|
_reactNative.DeviceEventEmitter.addListener("visibility-event", event => {
|
|
67
66
|
setIsAdVisibile(event);
|
|
68
67
|
});
|
|
69
68
|
_reactNative.DeviceEventEmitter.addListener("acknowledge", itemName => {
|
|
70
69
|
acknowledge(itemName);
|
|
71
70
|
});
|
|
72
|
-
if (props.offScreenAdZone && isAdVisible) {
|
|
73
|
-
sendAdImpression();
|
|
74
|
-
} else if (!props.offScreenAdZone) {
|
|
75
|
-
sendAdImpression();
|
|
76
|
-
}
|
|
77
71
|
return () => {
|
|
78
72
|
clearTimeout(cycleAdTimer);
|
|
79
|
-
_reactNative.DeviceEventEmitter.removeAllListeners("visibility-event");
|
|
80
73
|
_reactNative.DeviceEventEmitter.removeAllListeners("acknowledge");
|
|
81
74
|
};
|
|
82
75
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
76
|
}, []);
|
|
84
77
|
|
|
85
78
|
// Send impression on ad cycle.
|
|
86
|
-
(0,
|
|
79
|
+
(0, _react.useEffect)(() => {
|
|
87
80
|
startAdTimer();
|
|
88
|
-
if (
|
|
89
|
-
sendAdImpression();
|
|
90
|
-
} else if (!props.offScreenAdZone) {
|
|
81
|
+
if (isAdZoneVisible) {
|
|
91
82
|
sendAdImpression();
|
|
92
83
|
}
|
|
93
84
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94
85
|
}, [adIndexShown]);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
(0, React.useEffect)(() => {
|
|
98
|
-
if (props.offScreenAdZone && isAdVisible) {
|
|
99
|
-
sendAdImpression();
|
|
100
|
-
} else if (!props.offScreenAdZone) {
|
|
86
|
+
(0, _react.useEffect)(() => {
|
|
87
|
+
if (props.offScreenAdZone && isAdZoneVisible && props.adZoneData && props.adZoneData.ads && props.adZoneData.ads.length > adIndexShown && !props.adZoneData.ads[adIndexShown].impression_tracked) {
|
|
101
88
|
sendAdImpression();
|
|
102
89
|
}
|
|
103
90
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
104
|
-
}, [
|
|
91
|
+
}, [isAdZoneVisible]);
|
|
105
92
|
|
|
106
93
|
/**
|
|
107
94
|
* Generates all component related styles.
|
|
@@ -128,9 +115,8 @@ function AdZone(props) {
|
|
|
128
115
|
// Generate the styles each render in case the ad is updated with
|
|
129
116
|
// new settings that need to be reflected in the styles of the view.
|
|
130
117
|
const styles = generateStyles();
|
|
131
|
-
const currentAd = props.adZoneData.ads[adIndexShown] || undefined;
|
|
132
118
|
const finalMainViewStyle = styles.mainView;
|
|
133
|
-
if (!
|
|
119
|
+
if (!props.adZoneData.ads[adIndexShown] || !props.adZoneData.ads[adIndexShown].creative_url) {
|
|
134
120
|
// If there is no ad to display, make the view take up no space.
|
|
135
121
|
finalMainViewStyle.width = 0;
|
|
136
122
|
finalMainViewStyle.height = 0;
|
|
@@ -199,9 +185,11 @@ function AdZone(props) {
|
|
|
199
185
|
*/
|
|
200
186
|
function startAdTimer() {
|
|
201
187
|
clearTimeout(cycleAdTimer);
|
|
202
|
-
if (props.adZoneData.ads.length > 0) {
|
|
188
|
+
if (props.adZoneData.ads.length > 0 && props.adZoneData.ads[adIndexShown]) {
|
|
203
189
|
const refreshTime = props.adZoneData.ads[adIndexShown].refresh_time * 1000;
|
|
204
190
|
cycleAdTimer = setTimeout(cycleDisplayedAd, refreshTime);
|
|
191
|
+
} else {
|
|
192
|
+
cycleAdTimer = setTimeout(cycleDisplayedAd, 30000);
|
|
205
193
|
}
|
|
206
194
|
}
|
|
207
195
|
|
|
@@ -209,19 +197,23 @@ function AdZone(props) {
|
|
|
209
197
|
* Cycles to the next ad to display in the current available sequence of ads.
|
|
210
198
|
*/
|
|
211
199
|
function cycleDisplayedAd() {
|
|
212
|
-
// Start by determining the next ad index to display.
|
|
213
200
|
let nextAdIndex = 0;
|
|
201
|
+
|
|
202
|
+
// Start by determining the next ad index to display.
|
|
214
203
|
const lastAd = props.adZoneData.ads[adIndexShown];
|
|
215
204
|
if (adIndexShown < props.adZoneData.ads.length - 1) {
|
|
216
205
|
nextAdIndex = adIndexShown + 1;
|
|
217
|
-
}
|
|
218
|
-
if (nextAdIndex !== adIndexShown && lastAd.impression_tracked) {
|
|
219
|
-
// Reset ad impression tracking status.
|
|
220
|
-
lastAd.impression_tracked = false;
|
|
221
206
|
} else {
|
|
207
|
+
nextAdIndex = 0;
|
|
208
|
+
}
|
|
209
|
+
if (!lastAd.impression_tracked && !isAdZoneVisible) {
|
|
222
210
|
// Send invisible ad impression if ad was not visible before end of timer cycle.
|
|
223
211
|
triggerReportAdEvent(lastAd, _adadaptedApiTypes.ReportedEventType.INVISIBLE_IMPRESSION);
|
|
224
212
|
}
|
|
213
|
+
if (lastAd.impression_tracked) {
|
|
214
|
+
// Reset ad impression tracking status.
|
|
215
|
+
lastAd.impression_tracked = false;
|
|
216
|
+
}
|
|
225
217
|
setAdIndexShown(nextAdIndex);
|
|
226
218
|
}
|
|
227
219
|
|
|
@@ -230,50 +222,53 @@ function AdZone(props) {
|
|
|
230
222
|
*/
|
|
231
223
|
function sendAdImpression() {
|
|
232
224
|
const ad = props.adZoneData.ads[adIndexShown];
|
|
233
|
-
if (!ad.impression_tracked) {
|
|
225
|
+
if (ad.impression_tracked === undefined || !ad.impression_tracked) {
|
|
234
226
|
triggerReportAdEvent(ad, _adadaptedApiTypes.ReportedEventType.IMPRESSION);
|
|
235
227
|
ad.impression_tracked = true;
|
|
236
228
|
}
|
|
237
229
|
}
|
|
238
230
|
|
|
239
231
|
// Returned JSX.
|
|
240
|
-
return /*#__PURE__*/
|
|
241
|
-
style: finalMainViewStyle
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
x: e.nativeEvent.pageX,
|
|
252
|
-
y: e.nativeEvent.pageY
|
|
253
|
-
});
|
|
254
|
-
},
|
|
255
|
-
onTouchEnd: e => {
|
|
256
|
-
if (touchStartCoords) {
|
|
257
|
-
const touchEndCoords = {
|
|
232
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
233
|
+
style: finalMainViewStyle,
|
|
234
|
+
children: [props.adZoneData.ads[adIndexShown] && props.adZoneData.ads[adIndexShown].creative_url ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeWebview.WebView, {
|
|
235
|
+
source: {
|
|
236
|
+
uri: props.adZoneData.ads[adIndexShown].creative_url
|
|
237
|
+
},
|
|
238
|
+
androidLayerType: "hardware",
|
|
239
|
+
automaticallyAdjustContentInsets: false,
|
|
240
|
+
style: styles.webView,
|
|
241
|
+
onTouchStart: e => {
|
|
242
|
+
setTouchStartCoords({
|
|
258
243
|
x: e.nativeEvent.pageX,
|
|
259
244
|
y: e.nativeEvent.pageY
|
|
260
|
-
};
|
|
261
|
-
if (Math.abs(touchStartCoords.x - touchEndCoords.x) < props.xyDragDistanceAllowed && Math.abs(touchStartCoords.y - touchEndCoords.y) < props.xyDragDistanceAllowed) {
|
|
262
|
-
onAdZoneSelected(currentAd);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// Make sure to reset the start coords
|
|
266
|
-
setTouchStartCoords({
|
|
267
|
-
x: 0,
|
|
268
|
-
y: 0
|
|
269
245
|
});
|
|
246
|
+
},
|
|
247
|
+
onTouchEnd: e => {
|
|
248
|
+
if (touchStartCoords) {
|
|
249
|
+
const touchEndCoords = {
|
|
250
|
+
x: e.nativeEvent.pageX,
|
|
251
|
+
y: e.nativeEvent.pageY
|
|
252
|
+
};
|
|
253
|
+
if (Math.abs(touchStartCoords.x - touchEndCoords.x) < props.xyDragDistanceAllowed && Math.abs(touchStartCoords.y - touchEndCoords.y) < props.xyDragDistanceAllowed) {
|
|
254
|
+
onAdZoneSelected(props.adZoneData.ads[adIndexShown]);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Make sure to reset the start coords
|
|
258
|
+
setTouchStartCoords({
|
|
259
|
+
x: 0,
|
|
260
|
+
y: 0
|
|
261
|
+
});
|
|
262
|
+
}
|
|
270
263
|
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
}
|
|
264
|
+
}) : undefined, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
265
|
+
style: styles.reportAd,
|
|
266
|
+
children: props.adZoneData && props.adZoneData.ads[adIndexShown] ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ReportAdButton.ReportAdButton, {
|
|
267
|
+
adId: props.adZoneData.ads[adIndexShown].ad_id,
|
|
268
|
+
udid: props.udid
|
|
269
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {})
|
|
270
|
+
})]
|
|
271
|
+
});
|
|
272
|
+
};
|
|
273
|
+
exports.AdZone = AdZone;
|
|
279
274
|
//# sourceMappingURL=AdZone.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","adadaptedApiRequests","_adadaptedApiTypes","_reactNativeWebview","_util","_ReportAdButton","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","cycleAdTimer","AdZone","props","adIndexShown","setAdIndexShown","useState","Math","floor","random","adZoneData","ads","length","touchStartCoords","setTouchStartCoords","x","y","isAdZoneVisible","setIsAdVisibile","useEffect","DeviceEventEmitter","addListener","event","itemName","acknowledge","clearTimeout","removeAllListeners","startAdTimer","sendAdImpression","offScreenAdZone","impression_tracked","generateStyles","StyleSheet","create","mainView","width","height","webView","reportAd","position","top","right","styles","finalMainViewStyle","creative_url","onAdZoneSelected","currentlyDisplayedAd","action_type","AdActionType","EXTERNAL","action_path","Linking","openURL","then","CONTENT","payload","detailed_list_items","safeInvoke","onAddToListTriggered","cycleDisplayedAd","forEach","ad","item","product_title","triggerReportAdEvent","ReportedEventType","INTERACTION","eventType","currentTs","round","Date","getTime","reportAdEvent","app_id","appId","session_id","sessionId","udid","events","ad_id","impression_id","event_type","created_at","deviceOs","apiEnv","refreshTime","refresh_time","setTimeout","nextAdIndex","lastAd","INVISIBLE_IMPRESSION","undefined","IMPRESSION","jsxs","View","style","children","jsx","WebView","source","uri","androidLayerType","automaticallyAdjustContentInsets","onTouchStart","nativeEvent","pageX","pageY","onTouchEnd","touchEndCoords","abs","xyDragDistanceAllowed","ReportAdButton","adId","Fragment","exports"],"sourceRoot":"../../../src","sources":["components/AdZone.tsx"],"mappings":";;;;;;AAIA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,oBAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAOA,IAAAI,mBAAA,GAAAJ,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AAAkD,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,C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xC,CAAC,GAAGb,KAAK,CAAC2G,qBAAqB,EACjC;YACEjE,gBAAgB,CACZ1C,KAAK,CAACO,UAAU,CAACC,GAAG,CAACP,YAAY,CACrC,CAAC;UACL;;UAEA;UACAU,mBAAmB,CAAC;YAAEC,CAAC,EAAE,CAAC;YAAEC,CAAC,EAAE;UAAE,CAAC,CAAC;QACvC;MACJ;IAAE,CACL,CAAC,GACF2E,SAAS,eACb,IAAA/G,WAAA,CAAAqH,GAAA,EAAC3H,YAAA,CAAAwH,IAAI;MAACC,KAAK,EAAErD,MAAM,CAACJ,QAAS;MAAA0D,QAAA,EACxB7F,KAAK,CAACO,UAAU,IAAIP,KAAK,CAACO,UAAU,CAACC,GAAG,CAACP,YAAY,CAAC,gBACnD,IAAAxB,WAAA,CAAAqH,GAAA,EAACtH,eAAA,CAAAoI,cAAc;QACXC,IAAI,EAAE7G,KAAK,CAACO,UAAU,CAACC,GAAG,CAACP,YAAY,CAAC,CAAC2E,KAAM;QAC/CF,IAAI,EAAE1E,KAAK,CAAC0E;MAAK,CACpB,CAAC,gBAEF,IAAAjG,WAAA,CAAAqH,GAAA,EAAArH,WAAA,CAAAqI,QAAA,IAAI;IACP,CACC,CAAC;EAAA,CACL,CAAC;AAEf,CAAC;AAACC,OAAA,CAAAhH,MAAA,GAAAA,MAAA","ignoreList":[]}
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ReportAdButton = ReportAdButton;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
|
-
function
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
12
|
/**
|
|
12
13
|
* Creates the ReportAdButton component.
|
|
13
14
|
* @param props The component's props.
|
|
@@ -26,13 +27,14 @@ function ReportAdButton(props) {
|
|
|
26
27
|
reportAdUrlBase.searchParams.append("uid", props.udid);
|
|
27
28
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
29
|
}, [props]);
|
|
29
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
30
31
|
style: styles.buttonStyle,
|
|
31
32
|
onPress: () => {
|
|
32
33
|
_reactNative.Linking.openURL(reportAdUrlBase.toString());
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
},
|
|
35
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
36
|
+
source: require("../images/ReportIcon.png")
|
|
37
|
+
})
|
|
38
|
+
});
|
|
37
39
|
}
|
|
38
40
|
//# sourceMappingURL=ReportAdButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ReportAdButton","props","reportAdUrlBase","URL","styles","StyleSheet","create","buttonStyle","width","height","useEffect","searchParams","append","adId","udid","jsx","TouchableOpacity","style","onPress","Linking","openURL","toString","children","Image","source"],"sourceRoot":"../../../src","sources":["components/ReportAdButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAA4E,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAa5E;AACA;AACA;AACA;AACA;AACO,SAASW,cAAcA,CAACC,KAAY,EAAqB;EAC5D,MAAMC,eAAe,GAAG,IAAIC,GAAG,CAAC,6BAA6B,CAAC;EAE9D,MAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;IAC7BC,WAAW,EAAE;MACTC,KAAK,EAAE,EAAE;MACTC,MAAM,EAAE;IACZ;EACJ,CAAC,CAAC;EAEF,IAAAC,gBAAS,EAAC,MAAM;IACZR,eAAe,CAACS,YAAY,CAACC,MAAM,CAAC,KAAK,EAAEX,KAAK,CAACY,IAAI,CAAC;IACtDX,eAAe,CAACS,YAAY,CAACC,MAAM,CAAC,KAAK,EAAEX,KAAK,CAACa,IAAI,CAAC;IACtD;EACJ,CAAC,EAAE,CAACb,KAAK,CAAC,CAAC;EAEX,oBACI,IAAAtB,WAAA,CAAAoC,GAAA,EAACrC,YAAA,CAAAsC,gBAAgB;IACbC,KAAK,EAAEb,MAAM,CAACG,WAAY;IAC1BW,OAAO,EAAEA,CAAA,KAAM;MACXC,oBAAO,CAACC,OAAO,CAAClB,eAAe,CAACmB,QAAQ,CAAC,CAAC,CAAC;IAC/C,CAAE;IAAAC,QAAA,eAEF,IAAA3C,WAAA,CAAAoC,GAAA,EAACrC,YAAA,CAAA6C,KAAK;MAACC,MAAM,EAAE/C,OAAO,CAAC,0BAA0B;IAAE,CAAE;EAAC,CACxC,CAAC;AAE3B","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -12,16 +12,17 @@ var _AdZone = require("./components/AdZone");
|
|
|
12
12
|
var _util = require("./util");
|
|
13
13
|
var _package = _interopRequireDefault(require("../package.json"));
|
|
14
14
|
var _reactNativeBase = _interopRequireDefault(require("react-native-base64"));
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
function
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
19
|
/**
|
|
19
20
|
* The AdadaptedReactNativeSdk package/module definition.
|
|
20
21
|
*/
|
|
21
22
|
/**
|
|
22
23
|
* Enum representing possible device operating systems.
|
|
23
24
|
*/
|
|
24
|
-
let DeviceOS = /*#__PURE__*/function (DeviceOS) {
|
|
25
|
+
let DeviceOS = exports.DeviceOS = /*#__PURE__*/function (DeviceOS) {
|
|
25
26
|
DeviceOS["ANDROID"] = "android";
|
|
26
27
|
DeviceOS["IOS"] = "ios";
|
|
27
28
|
return DeviceOS;
|
|
@@ -29,8 +30,7 @@ let DeviceOS = /*#__PURE__*/function (DeviceOS) {
|
|
|
29
30
|
/**
|
|
30
31
|
* Enum defining the different API environments.
|
|
31
32
|
*/
|
|
32
|
-
exports.
|
|
33
|
-
let ApiEnv = /*#__PURE__*/function (ApiEnv) {
|
|
33
|
+
let ApiEnv = exports.ApiEnv = /*#__PURE__*/function (ApiEnv) {
|
|
34
34
|
ApiEnv["Prod"] = "https://ads.adadapted.com";
|
|
35
35
|
ApiEnv["Dev"] = "https://sandbox.adadapted.com";
|
|
36
36
|
ApiEnv["Mock"] = "MOCK_DATA";
|
|
@@ -39,8 +39,7 @@ let ApiEnv = /*#__PURE__*/function (ApiEnv) {
|
|
|
39
39
|
/**
|
|
40
40
|
* Enum defining the different API environments for List Manager.
|
|
41
41
|
*/
|
|
42
|
-
exports.
|
|
43
|
-
let ListManagerApiEnv = /*#__PURE__*/function (ListManagerApiEnv) {
|
|
42
|
+
let ListManagerApiEnv = exports.ListManagerApiEnv = /*#__PURE__*/function (ListManagerApiEnv) {
|
|
44
43
|
ListManagerApiEnv["Prod"] = "https://ec.adadapted.com";
|
|
45
44
|
ListManagerApiEnv["Dev"] = "https://sandec.adadapted.com";
|
|
46
45
|
ListManagerApiEnv["Mock"] = "MOCK_DATA";
|
|
@@ -49,8 +48,7 @@ let ListManagerApiEnv = /*#__PURE__*/function (ListManagerApiEnv) {
|
|
|
49
48
|
/**
|
|
50
49
|
* Enum defining the different API environments for the Payload Server.
|
|
51
50
|
*/
|
|
52
|
-
exports.
|
|
53
|
-
let PayloadApiEnv = /*#__PURE__*/function (PayloadApiEnv) {
|
|
51
|
+
let PayloadApiEnv = exports.PayloadApiEnv = /*#__PURE__*/function (PayloadApiEnv) {
|
|
54
52
|
PayloadApiEnv["Prod"] = "https://payload.adadapted.com";
|
|
55
53
|
PayloadApiEnv["Dev"] = "https://sandpayload.adadapted.com";
|
|
56
54
|
PayloadApiEnv["Mock"] = "MOCK_DATA";
|
|
@@ -71,7 +69,6 @@ let PayloadApiEnv = /*#__PURE__*/function (PayloadApiEnv) {
|
|
|
71
69
|
* {@link AdadaptedReactNativeSdk} so the interaction with the SDK all be
|
|
72
70
|
* done through this namespace.
|
|
73
71
|
*/
|
|
74
|
-
exports.PayloadApiEnv = PayloadApiEnv;
|
|
75
72
|
/**
|
|
76
73
|
* Class that acts as the AdAdapted SDK for react-native.
|
|
77
74
|
*/
|
|
@@ -151,7 +148,7 @@ class AdadaptedReactNativeSdk {
|
|
|
151
148
|
/**
|
|
152
149
|
* If provided, triggers when an "add to list" item is
|
|
153
150
|
* clicked in an ad zone.
|
|
154
|
-
* @param
|
|
151
|
+
* @param detail - The array of items to "add to list".
|
|
155
152
|
* @param isExternalPayload - If true, the items are from an external payload.
|
|
156
153
|
*/
|
|
157
154
|
|
|
@@ -170,11 +167,7 @@ class AdadaptedReactNativeSdk {
|
|
|
170
167
|
*/
|
|
171
168
|
|
|
172
169
|
/**
|
|
173
|
-
*
|
|
174
|
-
*/
|
|
175
|
-
isAdZoneVisible = true;
|
|
176
|
-
/**
|
|
177
|
-
* Ad zones that contain off-screen ads..
|
|
170
|
+
* Ad zones that contain off-screen ads.
|
|
178
171
|
*/
|
|
179
172
|
|
|
180
173
|
/**
|
|
@@ -253,27 +246,25 @@ class AdadaptedReactNativeSdk {
|
|
|
253
246
|
const adZoneInfoList = [];
|
|
254
247
|
for (const adZoneId in adZones) {
|
|
255
248
|
if (Object.prototype.hasOwnProperty.call(adZones, adZoneId)) {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
});
|
|
276
|
-
}
|
|
249
|
+
adZoneInfoList.push({
|
|
250
|
+
zoneId: adZones[adZoneId].id,
|
|
251
|
+
adZone: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AdZone.AdZone, {
|
|
252
|
+
appId: this.appId,
|
|
253
|
+
sessionId: this.sessionId,
|
|
254
|
+
udid: this.deviceInfo.udid,
|
|
255
|
+
deviceOs: this.deviceOs,
|
|
256
|
+
apiEnv: this.apiEnv,
|
|
257
|
+
xyDragDistanceAllowed: this.xyAdZoneDragDistanceAllowed || 25,
|
|
258
|
+
adZoneData: adZones[adZoneId],
|
|
259
|
+
onAddToListTriggered: details => {
|
|
260
|
+
(0, _util.safeInvoke)(this.onAddToListTriggered, {
|
|
261
|
+
zoneId: adZoneId,
|
|
262
|
+
items: details
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
isAdZoneVisible: true,
|
|
266
|
+
offScreenAdZone: false
|
|
267
|
+
}, adZoneId)
|
|
277
268
|
});
|
|
278
269
|
}
|
|
279
270
|
}
|
|
@@ -289,28 +280,28 @@ class AdadaptedReactNativeSdk {
|
|
|
289
280
|
const adZoneInfoList = [];
|
|
290
281
|
for (const adZoneId in adZones) {
|
|
291
282
|
if (Object.prototype.hasOwnProperty.call(adZones, adZoneId)) {
|
|
292
|
-
this.offScreenAdZone
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
})
|
|
312
|
-
}
|
|
313
|
-
}
|
|
283
|
+
if (this.offScreenAdZone && this.offScreenAdZone.length > 0 && this.offScreenAdZone.includes(Number(adZoneId))) {
|
|
284
|
+
adZoneInfoList.push({
|
|
285
|
+
zoneId: adZones[adZoneId].id,
|
|
286
|
+
adZone: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AdZone.AdZone, {
|
|
287
|
+
appId: this.appId,
|
|
288
|
+
sessionId: this.sessionId,
|
|
289
|
+
udid: this.deviceInfo.udid,
|
|
290
|
+
deviceOs: this.deviceOs,
|
|
291
|
+
apiEnv: this.apiEnv,
|
|
292
|
+
xyDragDistanceAllowed: this.xyAdZoneDragDistanceAllowed || 25,
|
|
293
|
+
adZoneData: adZones[adZoneId],
|
|
294
|
+
onAddToListTriggered: items => {
|
|
295
|
+
(0, _util.safeInvoke)(this.onAddToListTriggered, {
|
|
296
|
+
zoneId: adZoneId,
|
|
297
|
+
items
|
|
298
|
+
});
|
|
299
|
+
},
|
|
300
|
+
isAdZoneVisible: false,
|
|
301
|
+
offScreenAdZone: true
|
|
302
|
+
}, adZoneId)
|
|
303
|
+
});
|
|
304
|
+
}
|
|
314
305
|
}
|
|
315
306
|
}
|
|
316
307
|
return adZoneInfoList;
|
|
@@ -504,7 +495,6 @@ class AdadaptedReactNativeSdk {
|
|
|
504
495
|
* @param isVisible - Ad Zone visibility tracking.
|
|
505
496
|
*/
|
|
506
497
|
onAdZoneVisibilityChanged(isVisible) {
|
|
507
|
-
this.isAdZoneVisible = isVisible;
|
|
508
498
|
_reactNative.DeviceEventEmitter.emit("visibility-event", isVisible);
|
|
509
499
|
}
|
|
510
500
|
|
|
@@ -661,8 +651,10 @@ class AdadaptedReactNativeSdk {
|
|
|
661
651
|
const finalResultListStartsWith = [];
|
|
662
652
|
const finalResultListContains = [];
|
|
663
653
|
this.keywordInterceptSearchValue = searchTerm;
|
|
664
|
-
if (!this.deviceInfo
|
|
665
|
-
console.error("AdAdapted SDK has not been initialized.");
|
|
654
|
+
if (!this.deviceInfo) {
|
|
655
|
+
console.error("AdAdapted SDK has not been initialized with device info.");
|
|
656
|
+
} else if (!this.sessionId) {
|
|
657
|
+
console.error("AdAdapted SDK has not been initialized with session id.");
|
|
666
658
|
} else if (!this.keywordIntercepts) {
|
|
667
659
|
console.error("No available keyword intercepts.");
|
|
668
660
|
} else if (searchTerm && searchTerm.trim() && searchTerm.trim().length >= this.keywordIntercepts.min_match_length) {
|
|
@@ -733,8 +725,10 @@ class AdadaptedReactNativeSdk {
|
|
|
733
725
|
*/
|
|
734
726
|
reportKeywordInterceptTermSelected(termId) {
|
|
735
727
|
const termObj = this.getKeywordInterceptTerm(termId);
|
|
736
|
-
if (!this.deviceInfo
|
|
737
|
-
console.error("AdAdapted SDK has not been initialized.");
|
|
728
|
+
if (!this.deviceInfo) {
|
|
729
|
+
console.error("AdAdapted SDK has not been initialized with device info.");
|
|
730
|
+
} else if (!this.sessionId) {
|
|
731
|
+
console.error("AdAdapted SDK has not been initialized with session id.");
|
|
738
732
|
} else if (!this.keywordIntercepts) {
|
|
739
733
|
console.error("No available keyword intercepts.");
|
|
740
734
|
} else if (!termId || !termObj) {
|
|
@@ -775,8 +769,10 @@ class AdadaptedReactNativeSdk {
|
|
|
775
769
|
termObjs.push(termObj);
|
|
776
770
|
}
|
|
777
771
|
}
|
|
778
|
-
if (!this.deviceInfo
|
|
779
|
-
console.error("AdAdapted SDK has not been initialized.");
|
|
772
|
+
if (!this.deviceInfo) {
|
|
773
|
+
console.error("AdAdapted SDK has not been initialized with device info.");
|
|
774
|
+
} else if (!this.sessionId) {
|
|
775
|
+
console.error("AdAdapted SDK has not been initialized with session id.");
|
|
780
776
|
} else if (!this.keywordIntercepts) {
|
|
781
777
|
console.error("No available keyword intercepts.");
|
|
782
778
|
} else if (!termIds || termIds.length === 0 || termObjs.length === 0) {
|