@trustchex/react-native-sdk 1.205.0 → 1.215.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.
@@ -1,43 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  import { Platform } from 'react-native';
4
-
5
- /**
6
- * Native device info utility using React Native's built-in APIs
7
- * Replaces basic react-native-device-info functionality
8
- */
4
+ import DeviceInfo from 'react-native-device-info';
9
5
  export const NativeDeviceInfo = {
10
- getBrand: () => {
11
- return Platform.OS === 'ios' ? 'Apple' : 'Android';
12
- },
13
- getModel: () => {
14
- // For React Native, we can't get the exact model without native modules
15
- // But we can provide meaningful fallbacks
16
- if (Platform.OS === 'ios') {
17
- return Platform.isPad ? 'iPad' : 'iPhone';
18
- }
19
- return 'Android Device';
20
- },
21
- getSystemName: () => {
22
- return Platform.OS === 'ios' ? 'iOS' : 'Android';
23
- },
24
- getSystemVersion: () => {
25
- return Platform.Version.toString();
26
- },
27
- getUniqueId: async () => {
28
- // Generate a session-based unique identifier
29
- // This is not persistent across app restarts but serves the same purpose for most use cases
30
- const timestamp = Date.now().toString(36);
31
- const random = Math.random().toString(36).substr(2, 5);
32
- const platform = Platform.OS.substr(0, 3);
33
- return `${platform}-${timestamp}-${random}`;
34
- },
35
6
  generateHumanReadableIdentifier: async () => {
36
- const brand = NativeDeviceInfo.getBrand();
37
- const model = NativeDeviceInfo.getModel();
38
- const systemName = NativeDeviceInfo.getSystemName();
39
- const systemVersion = NativeDeviceInfo.getSystemVersion();
40
- const uniqueId = await NativeDeviceInfo.getUniqueId();
7
+ const brand = DeviceInfo.getBrand();
8
+ const model = DeviceInfo.getModel();
9
+ const systemName = Platform.OS === 'ios' ? 'iOS' : 'Android';
10
+ const systemVersion = DeviceInfo.getSystemVersion();
11
+ const uniqueId = await DeviceInfo.getUniqueId();
41
12
  return `${brand} ${model} (${systemName} ${systemVersion}) - ${uniqueId}`;
42
13
  }
43
14
  };
@@ -1,13 +1,4 @@
1
- /**
2
- * Native device info utility using React Native's built-in APIs
3
- * Replaces basic react-native-device-info functionality
4
- */
5
1
  export declare const NativeDeviceInfo: {
6
- getBrand: () => string;
7
- getModel: () => string;
8
- getSystemName: () => string;
9
- getSystemVersion: () => string;
10
- getUniqueId: () => Promise<string>;
11
2
  generateHumanReadableIdentifier: () => Promise<string>;
12
3
  };
13
4
  export default NativeDeviceInfo;
@@ -1 +1 @@
1
- {"version":3,"file":"native-device-info.utils.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/native-device-info.utils.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;oBACb,MAAM;oBAIN,MAAM;yBASD,MAAM;4BAIH,MAAM;uBAIL,OAAO,CAAC,MAAM,CAAC;2CAUK,OAAO,CAAC,MAAM,CAAC;CAS3D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"native-device-info.utils.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/native-device-info.utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;2CACgB,OAAO,CAAC,MAAM,CAAC;CAS3D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustchex/react-native-sdk",
3
- "version": "1.205.0",
3
+ "version": "1.215.0",
4
4
  "description": "Trustchex mobile app react native SDK for android or ios devices",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -92,6 +92,7 @@
92
92
  "react-native": "0.79.5",
93
93
  "react-native-builder-bob": "^0.40.13",
94
94
  "react-native-compressor": "^1.12.0",
95
+ "react-native-device-info": "^13.0.0",
95
96
  "react-native-fast-opencv": "^0.4.6",
96
97
  "react-native-fs": "^2.20.0",
97
98
  "react-native-gesture-handler": "^2.27.1",
@@ -128,6 +129,7 @@
128
129
  "react": ">=19.0.0",
129
130
  "react-native": ">=0.79.5",
130
131
  "react-native-compressor": ">=1.12.0",
132
+ "react-native-device-info": ">=13.0.0",
131
133
  "react-native-fast-opencv": ">=0.4.6",
132
134
  "react-native-fs": ">=2.20.0",
133
135
  "react-native-gesture-handler": ">=2.27.1",
@@ -168,6 +170,9 @@
168
170
  "react-native-compressor": {
169
171
  "optional": false
170
172
  },
173
+ "react-native-device-info": {
174
+ "optional": false
175
+ },
171
176
  "react-native-fast-opencv": {
172
177
  "optional": false
173
178
  },
@@ -1,47 +1,13 @@
1
1
  import { Platform } from 'react-native';
2
+ import DeviceInfo from 'react-native-device-info';
2
3
 
3
- /**
4
- * Native device info utility using React Native's built-in APIs
5
- * Replaces basic react-native-device-info functionality
6
- */
7
4
  export const NativeDeviceInfo = {
8
- getBrand: (): string => {
9
- return Platform.OS === 'ios' ? 'Apple' : 'Android';
10
- },
11
-
12
- getModel: (): string => {
13
- // For React Native, we can't get the exact model without native modules
14
- // But we can provide meaningful fallbacks
15
- if (Platform.OS === 'ios') {
16
- return Platform.isPad ? 'iPad' : 'iPhone';
17
- }
18
- return 'Android Device';
19
- },
20
-
21
- getSystemName: (): string => {
22
- return Platform.OS === 'ios' ? 'iOS' : 'Android';
23
- },
24
-
25
- getSystemVersion: (): string => {
26
- return Platform.Version.toString();
27
- },
28
-
29
- getUniqueId: async (): Promise<string> => {
30
- // Generate a session-based unique identifier
31
- // This is not persistent across app restarts but serves the same purpose for most use cases
32
- const timestamp = Date.now().toString(36);
33
- const random = Math.random().toString(36).substr(2, 5);
34
- const platform = Platform.OS.substr(0, 3);
35
-
36
- return `${platform}-${timestamp}-${random}`;
37
- },
38
-
39
5
  generateHumanReadableIdentifier: async (): Promise<string> => {
40
- const brand = NativeDeviceInfo.getBrand();
41
- const model = NativeDeviceInfo.getModel();
42
- const systemName = NativeDeviceInfo.getSystemName();
43
- const systemVersion = NativeDeviceInfo.getSystemVersion();
44
- const uniqueId = await NativeDeviceInfo.getUniqueId();
6
+ const brand = DeviceInfo.getBrand();
7
+ const model = DeviceInfo.getModel();
8
+ const systemName = Platform.OS === 'ios' ? 'iOS' : 'Android';
9
+ const systemVersion = DeviceInfo.getSystemVersion();
10
+ const uniqueId = await DeviceInfo.getUniqueId();
45
11
 
46
12
  return `${brand} ${model} (${systemName} ${systemVersion}) - ${uniqueId}`;
47
13
  },