@kontextso/sdk-react-native 0.0.10-rc.2 → 0.0.10-rc.4

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
@@ -1495,8 +1495,17 @@ var ErrorBoundary = class extends import_react11.default.Component {
1495
1495
  };
1496
1496
 
1497
1497
  // src/context/AdsProvider.tsx
1498
- var import_fetch = require("expo/fetch");
1498
+ var import_encoding = require("react-native-polyfill-globals/src/encoding");
1499
+ var import_readable_stream = require("react-native-polyfill-globals/src/readable-stream");
1500
+ var import_fetch = require("react-native-polyfill-globals/src/fetch");
1501
+ var import_react_native5 = require("react-native");
1499
1502
  var import_jsx_runtime6 = require("react/jsx-runtime");
1503
+ if (import_react_native5.Platform.OS !== "web") {
1504
+ (0, import_encoding.polyfill)();
1505
+ (0, import_readable_stream.polyfill)();
1506
+ (0, import_fetch.polyfill)();
1507
+ console.log("Polyfilled fetch.");
1508
+ }
1500
1509
  var VISITOR_ID_KEY2 = "brain-visitor-id";
1501
1510
  ErrorUtils.setGlobalHandler((error, isFatal) => {
1502
1511
  if (!isFatal) {
@@ -1551,7 +1560,7 @@ var AdsProvider = ({
1551
1560
  onAdView,
1552
1561
  onAdClick,
1553
1562
  reactNativePropStyles: styles,
1554
- customFetch: import_fetch.fetch,
1563
+ customFetch: fetch,
1555
1564
  isReactNative: true
1556
1565
  }
1557
1566
  )
package/dist/index.mjs CHANGED
@@ -1463,8 +1463,17 @@ var ErrorBoundary = class extends React5.Component {
1463
1463
  };
1464
1464
 
1465
1465
  // src/context/AdsProvider.tsx
1466
- import { fetch as fetch2 } from "expo/fetch";
1466
+ import { polyfill as polyfillEncoding } from "react-native-polyfill-globals/src/encoding";
1467
+ import { polyfill as polyfillReadableStream } from "react-native-polyfill-globals/src/readable-stream";
1468
+ import { polyfill as polyfillFetch } from "react-native-polyfill-globals/src/fetch";
1469
+ import { Platform as Platform2 } from "react-native";
1467
1470
  import { jsx as jsx6 } from "react/jsx-runtime";
1471
+ if (Platform2.OS !== "web") {
1472
+ polyfillEncoding();
1473
+ polyfillReadableStream();
1474
+ polyfillFetch();
1475
+ console.log("Polyfilled fetch.");
1476
+ }
1468
1477
  var VISITOR_ID_KEY2 = "brain-visitor-id";
1469
1478
  ErrorUtils.setGlobalHandler((error, isFatal) => {
1470
1479
  if (!isFatal) {
@@ -1519,7 +1528,7 @@ var AdsProvider = ({
1519
1528
  onAdView,
1520
1529
  onAdClick,
1521
1530
  reactNativePropStyles: styles,
1522
- customFetch: fetch2,
1531
+ customFetch: fetch,
1523
1532
  isReactNative: true
1524
1533
  }
1525
1534
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontextso/sdk-react-native",
3
- "version": "0.0.10-rc.2",
3
+ "version": "0.0.10-rc.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -47,7 +47,11 @@
47
47
  "react-dom": "*",
48
48
  "react-native": "*"
49
49
  },
50
- "dependencies": {},
50
+ "dependencies": {
51
+ "react-native-fetch-api": "^3.0.0",
52
+ "react-native-polyfill-globals": "^3.1.0",
53
+ "web-streams-polyfill": "^3.1.1"
54
+ },
51
55
  "files": [
52
56
  "dist/*"
53
57
  ]