|
|
|
@ -1,9 +1,7 @@
|
|
|
|
import 'dart:convert';
|
|
|
|
import 'dart:convert';
|
|
|
|
import 'dart:io';
|
|
|
|
import 'dart:io';
|
|
|
|
import 'dart:typed_data';
|
|
|
|
import 'dart:typed_data';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:http/http.dart';
|
|
|
|
import 'package:http/http.dart';
|
|
|
|
import 'package:mohem_flutter_app/api/api_client.dart';
|
|
|
|
import 'package:mohem_flutter_app/api/api_client.dart';
|
|
|
|
import 'package:mohem_flutter_app/app_state/app_state.dart';
|
|
|
|
import 'package:mohem_flutter_app/app_state/app_state.dart';
|
|
|
|
@ -31,10 +29,9 @@ class ChatApiClient {
|
|
|
|
"employeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(),
|
|
|
|
"employeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(),
|
|
|
|
"password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG",
|
|
|
|
"password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG",
|
|
|
|
"isMobile": true,
|
|
|
|
"isMobile": true,
|
|
|
|
"deviceToken":AppState().getIsHuawei ? AppState().getHuaweiPushToken : AppState().getDeviceToken,
|
|
|
|
"deviceToken": AppState().getIsHuawei ? AppState().getHuaweiPushToken : AppState().getDeviceToken,
|
|
|
|
"isHuaweiDevice": AppState().getIsHuawei,
|
|
|
|
"isHuaweiDevice": AppState().getIsHuawei,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
if (!kReleaseMode) {
|
|
|
|
if (!kReleaseMode) {
|
|
|
|
@ -188,10 +185,8 @@ class ChatApiClient {
|
|
|
|
return imagesData;
|
|
|
|
return imagesData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CallUser Login Token
|
|
|
|
// CallUser Login Token
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future<user.UserAutoLoginModel> getUserCallToken({required String userid}) async {
|
|
|
|
Future<user.UserAutoLoginModel> getUserCallToken({required String userid}) async {
|
|
|
|
user.UserAutoLoginModel userLoginResponse = user.UserAutoLoginModel();
|
|
|
|
user.UserAutoLoginModel userLoginResponse = user.UserAutoLoginModel();
|
|
|
|
Response response = await ApiClient().postJsonForResponse(
|
|
|
|
Response response = await ApiClient().postJsonForResponse(
|
|
|
|
@ -217,15 +212,18 @@ class ChatApiClient {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Call Decline On App Terminated State
|
|
|
|
// Call Decline On App Terminated State
|
|
|
|
|
|
|
|
|
|
|
|
Future<Response> callDecline({required int cUserID, required int tUserID, required String targetUsertoken}) async {
|
|
|
|
Future<Response> callDecline({required int cUserID, required int tUserID, required String targetUsertoken}) async {
|
|
|
|
|
|
|
|
// var headers = {'Content-Type': 'application/json'};
|
|
|
|
|
|
|
|
// var request = http.Request('POST', Uri.parse('https://apiderichat.hmg.com/api/user/calldecline'));
|
|
|
|
|
|
|
|
|
|
|
|
Response response = await ApiClient().postJsonForResponse(
|
|
|
|
Response response = await ApiClient().postJsonForResponse(
|
|
|
|
"${ApiConsts.chatLoginTokenUrl}calldecline",
|
|
|
|
"${ApiConsts.chatLoginTokenUrl}calldecline",
|
|
|
|
{"currentUserId": cUserID, "targetUserId": tUserID, "secretKey": "derichatmobileuser", "targetUserToken": targetUsertoken},
|
|
|
|
{"currentUserId": cUserID, "targetUserId": tUserID, "secretKey": "derichatmobileuser", "targetUserToken": targetUsertoken},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
print("res: " + response.body);
|
|
|
|
if (!kReleaseMode) {
|
|
|
|
if (!kReleaseMode) {
|
|
|
|
logger.i({"currentUserId": cUserID, "targetUserId": tUserID, "secretKey": "derichatmobileuser", "targetUserToken": targetUsertoken});
|
|
|
|
logger.i({"currentUserId": cUserID, "targetUserId": tUserID, "secretKey": "derichatmobileuser", "targetUserToken": targetUsertoken});
|
|
|
|
logger.i("res: " + response.body);
|
|
|
|
print("res: " + response.body);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return response;
|
|
|
|
return response;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|