@kontextso/sdk-react-native 2.3.1-rc.2 → 2.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/dist/index.js +12 -3
- package/dist/index.mjs +12 -3
- package/package.json +2 -2
- package/src/context/AdsProvider.tsx +4 -1
- package/src/formats/Format.tsx +11 -1
- package/src/formats/InlineAd.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -107,7 +107,7 @@ var sendMessage = (webViewRef, type, code, data) => {
|
|
|
107
107
|
}));
|
|
108
108
|
`);
|
|
109
109
|
};
|
|
110
|
-
var Format = ({ code, messageId, wrapper, ...otherParams }) => {
|
|
110
|
+
var Format = ({ code, messageId, wrapper, onEvent, ...otherParams }) => {
|
|
111
111
|
const context = (0, import_react2.useContext)(import_sdk_react.AdsContext);
|
|
112
112
|
const bid = (0, import_sdk_react.useBid)({ code, messageId });
|
|
113
113
|
const [height, setHeight] = (0, import_react2.useState)(0);
|
|
@@ -229,6 +229,10 @@ var Format = ({ code, messageId, wrapper, ...otherParams }) => {
|
|
|
229
229
|
}
|
|
230
230
|
}, message.data.timeout ?? 5e3);
|
|
231
231
|
break;
|
|
232
|
+
case "event-iframe":
|
|
233
|
+
onEvent?.(message.data);
|
|
234
|
+
context?.onAdEventInternal(message.data);
|
|
235
|
+
break;
|
|
232
236
|
}
|
|
233
237
|
},
|
|
234
238
|
{
|
|
@@ -277,6 +281,10 @@ var Format = ({ code, messageId, wrapper, ...otherParams }) => {
|
|
|
277
281
|
}
|
|
278
282
|
context?.onAdClickInternal(message.data);
|
|
279
283
|
break;
|
|
284
|
+
case "event-iframe":
|
|
285
|
+
onEvent?.(message.data);
|
|
286
|
+
context?.onAdEventInternal(message.data);
|
|
287
|
+
break;
|
|
280
288
|
}
|
|
281
289
|
},
|
|
282
290
|
{
|
|
@@ -426,7 +434,7 @@ var import_react_native2 = require("react-native");
|
|
|
426
434
|
var NativeRNKontext_default = import_react_native2.TurboModuleRegistry.getEnforcing("RNKontext");
|
|
427
435
|
|
|
428
436
|
// package.json
|
|
429
|
-
var version = "2.
|
|
437
|
+
var version = "2.4.0";
|
|
430
438
|
|
|
431
439
|
// src/context/AdsProvider.tsx
|
|
432
440
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -472,7 +480,7 @@ var getDevice = async () => {
|
|
|
472
480
|
// outputType: Not available without native module
|
|
473
481
|
},
|
|
474
482
|
network: {
|
|
475
|
-
// carrier: await DeviceInfo.getCarrier(),
|
|
483
|
+
// carrier: await DeviceInfo.getCarrier(), not supported in react-native-device-info v10.0.0
|
|
476
484
|
userAgent: await import_react_native_device_info.default.getUserAgent()
|
|
477
485
|
// detail: Requires @react-native-community/netinfo
|
|
478
486
|
// type: Requires @react-native-community/netinfo
|
|
@@ -503,6 +511,7 @@ var getDevice = async () => {
|
|
|
503
511
|
};
|
|
504
512
|
var getApp = async () => ({
|
|
505
513
|
bundleId: import_react_native_device_info.default.getBundleId(),
|
|
514
|
+
// not supported in react-native-device-info v10.0.0
|
|
506
515
|
// firstInstallTime: await DeviceInfo.getFirstInstallTime(),
|
|
507
516
|
// lastUpdateTime: await DeviceInfo.getLastUpdateTime(),
|
|
508
517
|
// startTime: await DeviceInfo.getStartupTime(),
|
package/dist/index.mjs
CHANGED
|
@@ -76,7 +76,7 @@ var sendMessage = (webViewRef, type, code, data) => {
|
|
|
76
76
|
}));
|
|
77
77
|
`);
|
|
78
78
|
};
|
|
79
|
-
var Format = ({ code, messageId, wrapper, ...otherParams }) => {
|
|
79
|
+
var Format = ({ code, messageId, wrapper, onEvent, ...otherParams }) => {
|
|
80
80
|
const context = useContext(AdsContext);
|
|
81
81
|
const bid = useBid({ code, messageId });
|
|
82
82
|
const [height, setHeight] = useState(0);
|
|
@@ -198,6 +198,10 @@ var Format = ({ code, messageId, wrapper, ...otherParams }) => {
|
|
|
198
198
|
}
|
|
199
199
|
}, message.data.timeout ?? 5e3);
|
|
200
200
|
break;
|
|
201
|
+
case "event-iframe":
|
|
202
|
+
onEvent?.(message.data);
|
|
203
|
+
context?.onAdEventInternal(message.data);
|
|
204
|
+
break;
|
|
201
205
|
}
|
|
202
206
|
},
|
|
203
207
|
{
|
|
@@ -246,6 +250,10 @@ var Format = ({ code, messageId, wrapper, ...otherParams }) => {
|
|
|
246
250
|
}
|
|
247
251
|
context?.onAdClickInternal(message.data);
|
|
248
252
|
break;
|
|
253
|
+
case "event-iframe":
|
|
254
|
+
onEvent?.(message.data);
|
|
255
|
+
context?.onAdEventInternal(message.data);
|
|
256
|
+
break;
|
|
249
257
|
}
|
|
250
258
|
},
|
|
251
259
|
{
|
|
@@ -395,7 +403,7 @@ import { TurboModuleRegistry } from "react-native";
|
|
|
395
403
|
var NativeRNKontext_default = TurboModuleRegistry.getEnforcing("RNKontext");
|
|
396
404
|
|
|
397
405
|
// package.json
|
|
398
|
-
var version = "2.
|
|
406
|
+
var version = "2.4.0";
|
|
399
407
|
|
|
400
408
|
// src/context/AdsProvider.tsx
|
|
401
409
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
@@ -441,7 +449,7 @@ var getDevice = async () => {
|
|
|
441
449
|
// outputType: Not available without native module
|
|
442
450
|
},
|
|
443
451
|
network: {
|
|
444
|
-
// carrier: await DeviceInfo.getCarrier(),
|
|
452
|
+
// carrier: await DeviceInfo.getCarrier(), not supported in react-native-device-info v10.0.0
|
|
445
453
|
userAgent: await DeviceInfo.getUserAgent()
|
|
446
454
|
// detail: Requires @react-native-community/netinfo
|
|
447
455
|
// type: Requires @react-native-community/netinfo
|
|
@@ -472,6 +480,7 @@ var getDevice = async () => {
|
|
|
472
480
|
};
|
|
473
481
|
var getApp = async () => ({
|
|
474
482
|
bundleId: DeviceInfo.getBundleId(),
|
|
483
|
+
// not supported in react-native-device-info v10.0.0
|
|
475
484
|
// firstInstallTime: await DeviceInfo.getFirstInstallTime(),
|
|
476
485
|
// lastUpdateTime: await DeviceInfo.getLastUpdateTime(),
|
|
477
486
|
// startTime: await DeviceInfo.getStartupTime(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kontextso/sdk-react-native",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Kontext SDK for React Native",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"react-native-webview": "^13.10.0"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@kontextso/sdk-react": "^2.0
|
|
58
|
+
"@kontextso/sdk-react": "^2.1.0"
|
|
59
59
|
},
|
|
60
60
|
"files": [
|
|
61
61
|
"dist/*",
|
|
@@ -50,7 +50,7 @@ const getDevice = async (): Promise<DeviceConfig> => {
|
|
|
50
50
|
// outputType: Not available without native module
|
|
51
51
|
},
|
|
52
52
|
network: {
|
|
53
|
-
// carrier: await DeviceInfo.getCarrier(),
|
|
53
|
+
// carrier: await DeviceInfo.getCarrier(), not supported in react-native-device-info v10.0.0
|
|
54
54
|
userAgent: await DeviceInfo.getUserAgent(),
|
|
55
55
|
// detail: Requires @react-native-community/netinfo
|
|
56
56
|
// type: Requires @react-native-community/netinfo
|
|
@@ -83,9 +83,12 @@ const getDevice = async (): Promise<DeviceConfig> => {
|
|
|
83
83
|
|
|
84
84
|
const getApp = async (): Promise<AppConfig> => ({
|
|
85
85
|
bundleId: DeviceInfo.getBundleId(),
|
|
86
|
+
|
|
87
|
+
// not supported in react-native-device-info v10.0.0
|
|
86
88
|
// firstInstallTime: await DeviceInfo.getFirstInstallTime(),
|
|
87
89
|
// lastUpdateTime: await DeviceInfo.getLastUpdateTime(),
|
|
88
90
|
// startTime: await DeviceInfo.getStartupTime(),
|
|
91
|
+
|
|
89
92
|
version: DeviceInfo.getVersion(),
|
|
90
93
|
})
|
|
91
94
|
|
package/src/formats/Format.tsx
CHANGED
|
@@ -36,7 +36,7 @@ const sendMessage = (
|
|
|
36
36
|
`)
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const Format = ({ code, messageId, wrapper, ...otherParams }: FormatProps) => {
|
|
39
|
+
const Format = ({ code, messageId, wrapper, onEvent, ...otherParams }: FormatProps) => {
|
|
40
40
|
const context = useContext(AdsContext)
|
|
41
41
|
|
|
42
42
|
const bid = useBid({ code, messageId })
|
|
@@ -183,6 +183,11 @@ const Format = ({ code, messageId, wrapper, ...otherParams }: FormatProps) => {
|
|
|
183
183
|
}
|
|
184
184
|
}, message.data.timeout ?? 5000)
|
|
185
185
|
break
|
|
186
|
+
|
|
187
|
+
case 'event-iframe':
|
|
188
|
+
onEvent?.(message.data)
|
|
189
|
+
context?.onAdEventInternal(message.data)
|
|
190
|
+
break
|
|
186
191
|
}
|
|
187
192
|
},
|
|
188
193
|
{
|
|
@@ -240,6 +245,11 @@ const Format = ({ code, messageId, wrapper, ...otherParams }: FormatProps) => {
|
|
|
240
245
|
}
|
|
241
246
|
context?.onAdClickInternal(message.data)
|
|
242
247
|
break
|
|
248
|
+
|
|
249
|
+
case 'event-iframe':
|
|
250
|
+
onEvent?.(message.data)
|
|
251
|
+
context?.onAdEventInternal(message.data)
|
|
252
|
+
break
|
|
243
253
|
}
|
|
244
254
|
},
|
|
245
255
|
{
|
package/src/formats/InlineAd.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Format from './Format'
|
|
2
|
-
import {
|
|
2
|
+
import type { FormatProps } from '@kontextso/sdk-react'
|
|
3
3
|
|
|
4
4
|
const InlineAd = ({ code, messageId, wrapper, ...props }: FormatProps) => {
|
|
5
5
|
return <Format code={code} messageId={messageId} wrapper={wrapper} {...props} />
|