Added Longpooling temporary as a transport type. Need to update that to websockets

development^2
FaizHashmiCS22 10 months ago
parent 366541f20f
commit 49d69ab809

@ -4,9 +4,8 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]"; const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; // const BASE_URL = 'https://ms.hmg.com/nscapi'; // UAT
const BASE_URL = 'https://ms.hmg.com/nscapi'; // UAT const BASE_URL = 'https://qline.hmg.com'; // LIVE
// const BASE_URL = 'https://qline.hmg.com'; // LIVE
const apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; // UAT const apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; // UAT
// const BASE_URL = 'http://10.200.204.11:2222/Services/Nurses.svc/REST'; // const BASE_URL = 'http://10.200.204.11:2222/Services/Nurses.svc/REST';
// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';

@ -32,7 +32,7 @@ class AppProvider extends ChangeNotifier {
while (currentDeviceIp == "") { while (currentDeviceIp == "") {
await getCurrentIP(); await getCurrentIP();
if (currentDeviceIp != "") { if (currentDeviceIp != "") {
callInitializations(); await callInitializations();
} else { } else {
await Future.delayed(const Duration(seconds: 2)); await Future.delayed(const Duration(seconds: 2));
} }
@ -145,6 +145,7 @@ class AppProvider extends ChangeNotifier {
WidgetsConfigModel? currentWidgetsConfigModel; WidgetsConfigModel? currentWidgetsConfigModel;
Future<void> getInfoWidgetsConfigurationsFromServer() async { Future<void> getInfoWidgetsConfigurationsFromServer() async {
log(" errorHellpo:");
WidgetsConfigModel? widgetsConfigModel = await API.getWidgetConfigsFromServer(currentDeviceIp, onFailure: (error) { WidgetsConfigModel? widgetsConfigModel = await API.getWidgetConfigsFromServer(currentDeviceIp, onFailure: (error) {
logger.i("Api call failed with this error: ${error.toString()}"); logger.i("Api call failed with this error: ${error.toString()}");
}); });

@ -41,12 +41,8 @@ class MyApp extends StatelessWidget {
builder: (context, constraints) { builder: (context, constraints) {
return OrientationBuilder(builder: (context, orientation) { return OrientationBuilder(builder: (context, orientation) {
SizeConfig().init(constraints, orientation); SizeConfig().init(constraints, orientation);
SystemChrome.setPreferredOrientations([ SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]);
DeviceOrientation.portraitUp, SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
// DeviceOrientation.portraitDown,
// DeviceOrientation.landscapeLeft,
// DeviceOrientation.landscapeRight,
]);
return MultiProvider( return MultiProvider(
providers: [ providers: [

@ -34,14 +34,16 @@ class SignalRHelper {
required VoidCallback onConnecting, required VoidCallback onConnecting,
}) async { }) async {
logger.i("Connecting Signal R with: $deviceIp"); logger.i("Connecting Signal R with: $deviceIp");
final url = hubBaseURL + "?IPAddress=$deviceIp"; final url = "$hubBaseURL?IPAddress=$deviceIp";
// final url = hubBaseURL; // final url = hubBaseURL;
connection = HubConnectionBuilder() connection = HubConnectionBuilder()
.withUrl( .withUrl(
url, url,
HttpConnectionOptions( HttpConnectionOptions(
client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true), client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true),
// transport: HttpTransportType.webSockets,
//TODO: IT MUST BE WEB SOCKETS
transport: HttpTransportType.longPolling,
logging: (level, message) => log(message), logging: (level, message) => log(message),
)) ))
.withAutomaticReconnect() .withAutomaticReconnect()

Loading…
Cancel
Save