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_LETTERS = "[a-zA-Z &'\"]";
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://qline.hmg.com'; // LIVE
// const BASE_URL = 'https://ms.hmg.com/nscapi'; // UAT
const BASE_URL = 'https://qline.hmg.com'; // LIVE
const apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; // UAT
// const BASE_URL = 'http://10.200.204.11:2222/Services/Nurses.svc/REST';
// const BASE_URL = 'https://hmgwebservices.com/';

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

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

@ -34,14 +34,16 @@ class SignalRHelper {
required VoidCallback onConnecting,
}) async {
logger.i("Connecting Signal R with: $deviceIp");
final url = hubBaseURL + "?IPAddress=$deviceIp";
final url = "$hubBaseURL?IPAddress=$deviceIp";
// final url = hubBaseURL;
connection = HubConnectionBuilder()
.withUrl(
url,
HttpConnectionOptions(
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),
))
.withAutomaticReconnect()

Loading…
Cancel
Save