|
|
|
|
@ -56,7 +56,7 @@ class CallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
Future<HubConnection> getHubConnection(String token) async {
|
|
|
|
|
HubConnection hub;
|
|
|
|
|
HttpConnectionOptions httpOp = HttpConnectionOptions(skipNegotiation: false, logMessageContent: true);
|
|
|
|
|
hub = HubConnectionBuilder().withUrl("${URLs.chatHubUrlChat}?accessTokenFactory=$token}", options: httpOp).withAutomaticReconnect(retryDelays: <int>[2000, 5000, 10000, 20000]).build();
|
|
|
|
|
hub = HubConnectionBuilder().withUrl("${URLs.chatHubUrlChat}?access_token=$token", options: httpOp).withAutomaticReconnect(retryDelays: <int>[2000, 5000, 10000, 20000]).build();
|
|
|
|
|
|
|
|
|
|
return hub;
|
|
|
|
|
}
|
|
|
|
|
@ -66,7 +66,7 @@ class CallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
await _disposeConnection();
|
|
|
|
|
// isLoading = true;
|
|
|
|
|
// notifyListeners();
|
|
|
|
|
http.Response response = await ApiClient().postJsonForResponse(URLs.chatSdkToken, {"apiKey": URLs.chatApiKey, "employeeNumber": employeeNumber, "voIPToken": null});
|
|
|
|
|
http.Response response = await ApiClient().postJsonForResponse(URLs.chatSdkToken, {"apiKey": URLs.chatApiKey, "employeeNumber": employeeNumber, "voIPToken": null});
|
|
|
|
|
if (response.statusCode == 200) {
|
|
|
|
|
ChatLoginResponse chatResponse = ChatLoginResponse.fromJson(jsonDecode(response.body));
|
|
|
|
|
print("chatResponse:${chatResponse.token}");
|
|
|
|
|
|