react-native-visit-rn-sdk 2.0.16 → 2.0.18

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.
Files changed (36) hide show
  1. package/lib/commonjs/SecondaryWebView.android.js +8 -26
  2. package/lib/commonjs/SecondaryWebView.android.js.map +1 -1
  3. package/lib/commonjs/SecondaryWebView.ios.js +14 -32
  4. package/lib/commonjs/SecondaryWebView.ios.js.map +1 -1
  5. package/lib/commonjs/Services.js +9 -11
  6. package/lib/commonjs/Services.js.map +1 -1
  7. package/lib/commonjs/androidLocation.js +9 -14
  8. package/lib/commonjs/androidLocation.js.map +1 -1
  9. package/lib/commonjs/constants.js +1 -2
  10. package/lib/commonjs/constants.js.map +1 -1
  11. package/lib/commonjs/index.android.js +14 -52
  12. package/lib/commonjs/index.android.js.map +1 -1
  13. package/lib/commonjs/index.ios.js +13 -49
  14. package/lib/commonjs/index.ios.js.map +1 -1
  15. package/lib/commonjs/iosLocation.js +9 -14
  16. package/lib/commonjs/iosLocation.js.map +1 -1
  17. package/lib/module/SecondaryWebView.android.js +5 -21
  18. package/lib/module/SecondaryWebView.android.js.map +1 -1
  19. package/lib/module/SecondaryWebView.ios.js +12 -28
  20. package/lib/module/SecondaryWebView.ios.js.map +1 -1
  21. package/lib/module/Services.js +7 -8
  22. package/lib/module/Services.js.map +1 -1
  23. package/lib/module/androidLocation.js +7 -10
  24. package/lib/module/androidLocation.js.map +1 -1
  25. package/lib/module/constants.js.map +1 -1
  26. package/lib/module/index.android.js +10 -45
  27. package/lib/module/index.android.js.map +1 -1
  28. package/lib/module/index.ios.js +10 -44
  29. package/lib/module/index.ios.js.map +1 -1
  30. package/lib/module/iosLocation.js +7 -10
  31. package/lib/module/iosLocation.js.map +1 -1
  32. package/package.json +7 -6
  33. package/src/SecondaryWebView.android.js +0 -17
  34. package/src/SecondaryWebView.ios.js +1 -17
  35. package/src/index.android.js +0 -35
  36. package/src/index.ios.js +0 -35
package/src/index.ios.js CHANGED
@@ -56,26 +56,6 @@ const unescapeHTML = (str) =>
56
56
 
57
57
  const visitEvent = 'visit-event';
58
58
 
59
- // Domains that stay inside the WebView. Matches the host exactly or any of its
60
- // subdomains. Everything else (wa.me, tel:, mailto: ...) is handed to the OS.
61
- const INTERNAL_HOSTS = ['getvisitapp.net', 'getvisitapp.com', 'myhubble.money'];
62
-
63
- // Note: does not use `new URL()` - React Native's URL polyfill throws
64
- // "URL.hostname is not implemented".
65
- const isInternalUrl = (url) => {
66
- const link = typeof url === 'string' ? url.trim() : '';
67
- const match = /^https?:\/\/([^/?#]+)/i.exec(link);
68
- if (!match) {
69
- // about:blank / data: / blob: are rendered by the WebView itself.
70
- return /^(about|data|blob):/i.test(link);
71
- }
72
- // Strip any userinfo and port before comparing.
73
- const host = match[1].split('@').pop().split(':')[0].toLowerCase();
74
- return INTERNAL_HOSTS.some(
75
- (domain) => host === domain || host.endsWith(`.${domain}`)
76
- );
77
- };
78
-
79
59
  const VisitRnSdkView = ({
80
60
  cpsid,
81
61
  baseUrl,
@@ -371,21 +351,6 @@ const VisitRnSdkView = ({
371
351
  javascriptEnabled
372
352
  webviewDebuggingEnabled={Boolean(isLoggingEnabled)}
373
353
  onMessage={handleMessage}
374
- onShouldStartLoadWithRequest={(request) => {
375
- // Sub-frames (iframes) are never handed to the OS.
376
- if (request.isTopFrame === false) {
377
- return true;
378
- }
379
- if (isInternalUrl(request.url)) {
380
- return true;
381
- }
382
- Linking.openURL(request.url).catch((err) => {
383
- if (isLoggingEnabled) {
384
- console.warn('Linking.openURL error: ', err);
385
- }
386
- });
387
- return false;
388
- }}
389
354
  onError={(errorMessage) => {
390
355
  EventRegister.emitEvent(visitEvent, {
391
356
  message: 'web-view-error',