@test-web/react-native-sdk 2.0.0 → 2.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@test-web/react-native-sdk",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Dynamic React Native SDK for document verification with API-driven configuration",
5
5
  "main": "src/index.tsx",
6
6
  "types": "src/index.tsx",
@@ -1,4 +1,4 @@
1
- export const SANDBOX_BASE_URL = 'https://sandbox-api.idmerit.com';
1
+ export const SANDBOX_BASE_URL = 'https://sandbox.idmvalidate.com';
2
2
  export const PRODUCTION_BASE_URL = 'https://api.idmerit.com';
3
3
 
4
4
  export const getBaseURL = (environment: 'sandbox' | 'production'): string => {
@@ -72,17 +72,37 @@ const getUserData = async (): Promise<UserData> => {
72
72
  try {
73
73
  // Try to import geolocation if available
74
74
  const Geolocation = require('react-native-geolocation-service');
75
- location = await new Promise((resolve, reject) => {
76
- Geolocation.getCurrentPosition(
77
- resolve,
78
- reject,
79
- {
80
- enableHighAccuracy: true,
81
- timeout: 15000,
82
- maximumAge: 10000,
83
- }
84
- );
85
- });
75
+
76
+ // Check if Geolocation is properly imported and has the method
77
+ if (Geolocation && typeof Geolocation.getCurrentPosition === 'function') {
78
+ location = await new Promise((resolve, reject) => {
79
+ Geolocation.getCurrentPosition(
80
+ resolve,
81
+ reject,
82
+ {
83
+ enableHighAccuracy: true,
84
+ timeout: 15000,
85
+ maximumAge: 10000,
86
+ }
87
+ );
88
+ });
89
+ } else if (Geolocation && Geolocation.default && typeof Geolocation.default.getCurrentPosition === 'function') {
90
+ // Try default export
91
+ location = await new Promise((resolve, reject) => {
92
+ Geolocation.default.getCurrentPosition(
93
+ resolve,
94
+ reject,
95
+ {
96
+ enableHighAccuracy: true,
97
+ timeout: 15000,
98
+ maximumAge: 10000,
99
+ }
100
+ );
101
+ });
102
+ } else {
103
+ console.warn('Geolocation library not properly configured');
104
+ location = null;
105
+ }
86
106
  } catch (err) {
87
107
  console.warn('Location fetch error:', err);
88
108
  location = null;