@kontextso/sdk-react-native 2.1.0-rc.1 → 2.1.1-rc.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 CHANGED
@@ -111,7 +111,7 @@ var Format = ({ code, messageId, wrapper, ...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);
114
- const iframeUrl = (0, import_sdk_react.useIframeUrl)(context, bid, code, messageId);
114
+ const iframeUrl = (0, import_sdk_react.useIframeUrl)(context, bid, code, messageId, "sdk-react-native", otherParams.theme);
115
115
  const modalUrl = iframeUrl.replace("/api/frame/", "/api/modal/");
116
116
  const [showIframe, setShowIframe] = (0, import_react2.useState)(false);
117
117
  const [iframeLoaded, setIframeLoaded] = (0, import_react2.useState)(false);
@@ -402,6 +402,7 @@ var InlineAd_default = InlineAd;
402
402
  var import_sdk_react2 = require("@kontextso/sdk-react");
403
403
  var import_react_native2 = require("react-native");
404
404
  var import_react_native_device_info = __toESM(require("react-native-device-info"));
405
+ var import_soundon = require("@kontextso/soundon");
405
406
  var import_jsx_runtime4 = require("react/jsx-runtime");
406
407
  ErrorUtils.setGlobalHandler((error, isFatal) => {
407
408
  if (!isFatal) {
@@ -410,7 +411,7 @@ ErrorUtils.setGlobalHandler((error, isFatal) => {
410
411
  import_sdk_react2.log.error(error);
411
412
  }
412
413
  });
413
- var getDevice = () => {
414
+ var getDevice = async () => {
414
415
  try {
415
416
  const os = import_react_native2.Platform.OS;
416
417
  const systemVersion = import_react_native_device_info.default.getSystemVersion();
@@ -420,6 +421,12 @@ var getDevice = () => {
420
421
  const deviceType = import_react_native_device_info.default.getDeviceType();
421
422
  const appBundleId = import_react_native_device_info.default.getBundleId();
422
423
  const appVersion = import_react_native_device_info.default.getVersion();
424
+ let soundOn = false;
425
+ try {
426
+ soundOn = await (0, import_soundon.isSoundOn)();
427
+ } catch (error) {
428
+ import_sdk_react2.log.warn("Failed to read output volume", error);
429
+ }
423
430
  const rnv = import_react_native2.Platform.constants.reactNativeVersion;
424
431
  const reactNativeVersion = `${rnv.major}.${rnv.minor}.${rnv.patch}`;
425
432
  return {
@@ -431,7 +438,8 @@ var getDevice = () => {
431
438
  deviceId,
432
439
  deviceType,
433
440
  appBundleId,
434
- appVersion
441
+ appVersion,
442
+ soundOn
435
443
  };
436
444
  } catch (error) {
437
445
  console.error(error);
package/dist/index.mjs CHANGED
@@ -80,7 +80,7 @@ var Format = ({ code, messageId, wrapper, ...otherParams }) => {
80
80
  const context = useContext(AdsContext);
81
81
  const bid = useBid({ code, messageId });
82
82
  const [height, setHeight] = useState(0);
83
- const iframeUrl = useIframeUrl(context, bid, code, messageId);
83
+ const iframeUrl = useIframeUrl(context, bid, code, messageId, "sdk-react-native", otherParams.theme);
84
84
  const modalUrl = iframeUrl.replace("/api/frame/", "/api/modal/");
85
85
  const [showIframe, setShowIframe] = useState(false);
86
86
  const [iframeLoaded, setIframeLoaded] = useState(false);
@@ -371,6 +371,7 @@ var InlineAd_default = InlineAd;
371
371
  import { AdsProviderInternal, log } from "@kontextso/sdk-react";
372
372
  import { Platform } from "react-native";
373
373
  import DeviceInfo from "react-native-device-info";
374
+ import { isSoundOn } from "@kontextso/soundon";
374
375
  import { jsx as jsx4 } from "react/jsx-runtime";
375
376
  ErrorUtils.setGlobalHandler((error, isFatal) => {
376
377
  if (!isFatal) {
@@ -379,7 +380,7 @@ ErrorUtils.setGlobalHandler((error, isFatal) => {
379
380
  log.error(error);
380
381
  }
381
382
  });
382
- var getDevice = () => {
383
+ var getDevice = async () => {
383
384
  try {
384
385
  const os = Platform.OS;
385
386
  const systemVersion = DeviceInfo.getSystemVersion();
@@ -389,6 +390,12 @@ var getDevice = () => {
389
390
  const deviceType = DeviceInfo.getDeviceType();
390
391
  const appBundleId = DeviceInfo.getBundleId();
391
392
  const appVersion = DeviceInfo.getVersion();
393
+ let soundOn = false;
394
+ try {
395
+ soundOn = await isSoundOn();
396
+ } catch (error) {
397
+ log.warn("Failed to read output volume", error);
398
+ }
392
399
  const rnv = Platform.constants.reactNativeVersion;
393
400
  const reactNativeVersion = `${rnv.major}.${rnv.minor}.${rnv.patch}`;
394
401
  return {
@@ -400,7 +407,8 @@ var getDevice = () => {
400
407
  deviceId,
401
408
  deviceType,
402
409
  appBundleId,
403
- appVersion
410
+ appVersion,
411
+ soundOn
404
412
  };
405
413
  } catch (error) {
406
414
  console.error(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontextso/sdk-react-native",
3
- "version": "2.1.0-rc.1",
3
+ "version": "2.1.1-rc.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -52,7 +52,8 @@
52
52
  "react-native-webview": "^13.15.0"
53
53
  },
54
54
  "dependencies": {
55
- "@kontextso/sdk-react": "^1.2.3"
55
+ "@kontextso/sdk-react": "^1.2.4",
56
+ "@kontextso/soundon": "^1.0.0"
56
57
  },
57
58
  "files": [
58
59
  "dist/*",