@propel-nsl/propel-react-native-sdk 1.0.1 → 1.0.2
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": "@propel-nsl/propel-react-native-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Propel Mobile SDK - React Native Core",
|
|
5
5
|
"files": ["src/", "src-app/", "lib/", "assets/", "index.ts", "CLIENT_INTEGRATION_GUIDE.md", "RN_HOST_INTEGRATION.md", "README.md"],
|
|
6
6
|
"main": "index.ts",
|
|
@@ -272,12 +272,6 @@ const Profile: React.FC<ProfileProps> = ({ navigation }) => {
|
|
|
272
272
|
<Text style={styles.userName}>
|
|
273
273
|
{myProfileData?.client?.employee?.name}
|
|
274
274
|
</Text>
|
|
275
|
-
<Text style={styles.userEmail}>
|
|
276
|
-
{myProfileData?.client?.employee?.email}
|
|
277
|
-
</Text>
|
|
278
|
-
<Text style={styles.userPhone}>
|
|
279
|
-
{myProfileData?.client?.employee?.phone}
|
|
280
|
-
</Text>
|
|
281
275
|
</View>
|
|
282
276
|
|
|
283
277
|
{/* My Account Section */}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import api, { api1 } from "./api";
|
|
13
13
|
import ENDPOINTS from "./endpoints";
|
|
14
14
|
import DeviceInfo from "react-native-device-info";
|
|
15
|
-
import { getSDKCredentials } from "./sdkCredentials";
|
|
15
|
+
import { getSDKCredentials } from "./sdkCredentials";
|
|
16
16
|
|
|
17
17
|
let cachedDeviceId: string | null = null;
|
|
18
18
|
|
|
@@ -60,25 +60,29 @@ export const verifyMobileOtpApi = (payload: VerifyMobileOtpPayload) => {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export const sdkAuthApi = async () => {
|
|
63
|
+
const creds = getSDKCredentials();
|
|
64
|
+
if (!creds?.authToken || !creds?.authId) {
|
|
65
|
+
throw new Error("SDK credentials missing: authToken/authId not set");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const environment = creds.environment?.toUpperCase?.() || "PRODUCTION";
|
|
69
|
+
|
|
63
70
|
const payload = {
|
|
64
|
-
device_id: "device123",
|
|
65
|
-
client_name: "AndroidApp",
|
|
66
|
-
client_version: "1.0.0",
|
|
67
|
-
environment
|
|
71
|
+
device_id: creds.deviceId || "device123",
|
|
72
|
+
client_name: creds.clientName || "AndroidApp",
|
|
73
|
+
client_version: creds.clientVersion || "1.0.0",
|
|
74
|
+
environment,
|
|
68
75
|
user: {
|
|
69
|
-
user_id: "uuid",
|
|
70
|
-
name: "abc12345",
|
|
71
|
-
mobile: "9030992316",
|
|
72
|
-
email: "abc12345@yopmail.com",
|
|
76
|
+
user_id: creds.userId || "uuid",
|
|
73
77
|
},
|
|
74
78
|
};
|
|
75
|
-
|
|
79
|
+
|
|
76
80
|
const headers = {
|
|
77
|
-
"X-Auth-Token":
|
|
78
|
-
"X-Auth-Id":
|
|
81
|
+
"X-Auth-Token": creds.authToken,
|
|
82
|
+
"X-Auth-Id": creds.authId,
|
|
79
83
|
"Content-Type": "application/json",
|
|
80
84
|
};
|
|
81
|
-
|
|
85
|
+
|
|
82
86
|
return api1.post(ENDPOINTS.SDK_AUTH_INIT, payload, { headers });
|
|
83
87
|
};
|
|
84
88
|
export const myOrdersApi = async () => {
|