@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 +1 -1
- package/src/config/apiConfig.ts +1 -1
- package/src/services/getUserData.ts +31 -11
package/package.json
CHANGED
package/src/config/apiConfig.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const SANDBOX_BASE_URL = 'https://sandbox
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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;
|