api changes to update token.

merge-AudioVideo-Copilot
Sikander Saleem 1 month ago
parent e022aff0b0
commit 23fff42c17

@ -21,7 +21,7 @@ class URLs {
static const String chatHubUrlChat = "$chatHubUrl/hubs/chat"; // new V2 apis static const String chatHubUrlChat = "$chatHubUrl/hubs/chat"; // new V2 apis
static const String resetMessageCount = "$chatHubUrlApi/userChatHistory/AckMessages"; // new V2 apis static const String resetMessageCount = "$chatHubUrlApi/userChatHistory/AckMessages"; // new V2 apis
static const String unreadMessages = "$chatHubUrlApi/userChatHistory/unread-messages"; // new V2 apis static const String unreadMessages = "$chatHubUrlApi/userChatHistory/unread-messages"; // new V2 apis
static const String updateDeviceInfo = "$chatHubUrlApi/user/update-device-info"; // new V2 apis static const String updateDeviceInfo = "$chatHubUrlApi/auth/update-device-info"; // new V2 apis
static const String chatApiKey = "f53a98286f82798d588f67a7f0db19f7aebc839e"; // new V2 apis static const String chatApiKey = "f53a98286f82798d588f67a7f0db19f7aebc839e"; // new V2 apis
static String _host = host1; static String _host = host1;

@ -61,13 +61,14 @@ class ChatApiClient {
Future<bool> updateDeviceInfo(String employeeNumber) async { Future<bool> updateDeviceInfo(String employeeNumber) async {
final Map<String, dynamic> payload = { final Map<String, dynamic> payload = {
"apiKey": URLs.chatApiKey,
"employeeNumber": employeeNumber, "employeeNumber": employeeNumber,
"deviceToken": FirebaseNotificationManger.token, "deviceToken": FirebaseNotificationManger.token,
"isHuaweiDevice": (await myPlatform()) == "HUAWEI", "isHuaweiDevice": (await myPlatform()) == "HUAWEI",
"platform": await myPlatform(), "platform": await myPlatform(),
"voIPToken": FirebaseNotificationManger.voipToken, "voIPToken": FirebaseNotificationManger.voipToken,
}; };
final Response response = await ApiClient().postJsonForResponse(URLs.updateDeviceInfo, payload, token: chatLoginResponse!.token); final Response response = await ApiClient().postJsonForResponse(URLs.updateDeviceInfo, payload);
return response.statusCode == 200; return response.statusCode == 200;
} }

Loading…
Cancel
Save