diff --git a/lib/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart index a9b65eab..8a969377 100644 --- a/lib/controllers/api_routes/urls.dart +++ b/lib/controllers/api_routes/urls.dart @@ -21,7 +21,7 @@ class URLs { static const String chatHubUrlChat = "$chatHubUrl/hubs/chat"; // 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 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 String _host = host1; diff --git a/lib/modules/cx_module/chat/chat_api_client.dart b/lib/modules/cx_module/chat/chat_api_client.dart index ab9cba3a..0108e1ed 100644 --- a/lib/modules/cx_module/chat/chat_api_client.dart +++ b/lib/modules/cx_module/chat/chat_api_client.dart @@ -61,13 +61,14 @@ class ChatApiClient { Future updateDeviceInfo(String employeeNumber) async { final Map payload = { + "apiKey": URLs.chatApiKey, "employeeNumber": employeeNumber, "deviceToken": FirebaseNotificationManger.token, "isHuaweiDevice": (await myPlatform()) == "HUAWEI", "platform": await myPlatform(), "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; }