diff --git a/lib/analytics/flows/appointments.dart b/lib/analytics/flows/appointments.dart index bd69769d..6c7cb547 100644 --- a/lib/analytics/flows/appointments.dart +++ b/lib/analytics/flows/appointments.dart @@ -74,7 +74,7 @@ class Appointment{ 'treatment_type' : doctor.clinicName, 'doctor_name' : doctor.name, 'doctor_nationality' : doctor.nationalityName, - 'doctor_gender' : doctor.gender, + 'doctor_gender' : doctor.genderDescription, }); } @@ -88,7 +88,7 @@ class Appointment{ 'treatment_type' : doctor.clinicName, 'doctor_name' : doctor.name, 'doctor_nationality' : doctor.nationalityName, - 'doctor_gender' : doctor.gender, + 'doctor_gender' : doctor.genderDescription, }); } @@ -101,7 +101,7 @@ class Appointment{ 'treatment_type' : doctor.clinicName, 'doctor_name' : doctor.name, 'doctor_nationality' : doctor.nationalityName, - 'doctor_gender' : doctor.gender, + 'doctor_gender' : doctor.genderDescription, 'appointment_day' : day }); } @@ -117,7 +117,7 @@ class Appointment{ 'treatment_type' : doctor.clinicName, 'doctor_name' : doctor.name, 'doctor_nationality' : doctor.nationalityName, - 'doctor_gender' : doctor.gender, + 'doctor_gender' : doctor.genderDescription, 'appointment_day' : day, 'appointment_hour' : time }); @@ -134,7 +134,7 @@ class Appointment{ 'treatment_type' : doctor.clinicName, 'doctor_name' : doctor.name, 'doctor_nationality' : doctor.nationalityName, - 'doctor_gender' : doctor.gender, + 'doctor_gender' : doctor.genderDescription, 'appointment_day' : day, 'appointment_hour' : time }); @@ -151,7 +151,7 @@ class Appointment{ 'treatment_type' : doctor.clinicName, 'doctor_name' : doctor.name, 'doctor_nationality' : doctor.nationalityName, - 'doctor_gender' : doctor.gender, + 'doctor_gender' : doctor.genderDescription, 'appointment_day' : day, 'appointment_hour' : time }); @@ -168,7 +168,7 @@ class Appointment{ 'treatment_type' : doctor.clinicName, 'doctor_name' : doctor.name, 'doctor_nationality' : doctor.nationalityName, - 'doctor_gender' : doctor.gender, + 'doctor_gender' : doctor.genderDescription, 'appointment_day' : day, 'appointment_hour' : time }); @@ -200,6 +200,30 @@ class Appointment{ }); } + // R033 + payment_method({@required String appointment_type, clinic, payment_method, payment_type}){ + logger('payment_method', parameters: { + 'appointment_type' : appointment_type, + 'clinic_type' : clinic, + 'payment_method' : payment_method, + 'payment_type' : payment_type + }); + } + + + // R036 + payment_success({@required String appointment_type, clinic, hospital, payment_method, payment_type, txn_number, txn_amount, txn_currency}){ + // appointment_type + // clinic_type_online + // payment_method + // payment_type: 'appointment' + // hospital_name + // transaction_number + // transaction_amount + // transaction_currency + } + + // Note : - Payment flow beyond this step are same as listed under ‘Advance Payment’ section of this document appointment_detail_action({@required AppoitmentAllHistoryResultList appointment, @required String action}){ logger('appointment_detail_action', parameters: { diff --git a/lib/analytics/flows/live_care.dart b/lib/analytics/flows/live_care.dart index fd7d03d4..6d2f0c81 100644 --- a/lib/analytics/flows/live_care.dart +++ b/lib/analytics/flows/live_care.dart @@ -40,7 +40,7 @@ class LiveCare{ // R032 livecare_immediate_consultation_TnC({@required String clinic}){ - logger('livecare_immediate_consultation_TnC', parameters: { + logger('livecare_immediate_consultation_tandc', parameters: { 'clinic_type_online' : clinic }); } diff --git a/lib/analytics/flows/todo_list.dart b/lib/analytics/flows/todo_list.dart index bfcde052..9a63a26c 100644 --- a/lib/analytics/flows/todo_list.dart +++ b/lib/analytics/flows/todo_list.dart @@ -10,44 +10,44 @@ class TodoList{ // R047.1 to_do_list_pay_now(AppoitmentAllHistoryResultList appointment){ logger('to_do_list_pay_now', parameters: { - 'appointment_type' : appointment.appointmentType, + 'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'clinic_type_online' : appointment.clinicName, 'hospital_name' : appointment.projectName, - 'doctor_name' : appointment.doctorName, - 'payment_type' : appointment.patientType, + 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, + 'payment_type' : 'appointment', }); } // R047.2 to_do_list_more_details(AppoitmentAllHistoryResultList appointment){ logger('to_do_list_more_details', parameters: { - 'appointment_type' : appointment.appointmentType, + 'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'clinic_type_online' : appointment.clinicName, 'hospital_name' : appointment.projectName, - 'doctor_name' : appointment.doctorName, - 'payment_type' : appointment.patientType, + 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, + 'payment_type' : 'appointment', }); } // R048 to_do_list_confirm_payment_details(AppoitmentAllHistoryResultList appointment){ logger('to_do_list_confirm_payment_details', parameters: { - 'appointment_type' : appointment.appointmentType, + 'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'clinic_type_online' : appointment.clinicName, 'hospital_name' : appointment.projectName, - 'doctor_name' : appointment.doctorName, - 'payment_type' : appointment.patientType, + 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, + 'payment_type' : 'appointment', }); } // R048 to_do_list_cancel_payment_details(AppoitmentAllHistoryResultList appointment){ logger('to_do_list_cancel_payment_details', parameters: { - 'appointment_type' : appointment.appointmentType, + 'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'clinic_type_online' : appointment.clinicName, 'hospital_name' : appointment.projectName, - 'doctor_name' : appointment.doctorName, - 'payment_type' : appointment.patientType, + 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, + 'payment_type' : 'appointment', }); } @@ -57,63 +57,63 @@ class TodoList{ // 'appointment_type' : appointment.appointmentType, // 'clinic_type_online' : appointment.clinicName, // 'hospital_name' : appointment.projectName, - // 'doctor_name' : appointment.doctorName, - // 'payment_type' : appointment.patientType, + // 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, + // 'payment_type' : 'appointment', // }); // } // R049.2 to_do_list_cancel_appointment(AppoitmentAllHistoryResultList appointment){ logger('to_do_list_cancel_appointment', parameters: { - 'appointment_type' : appointment.appointmentType, + 'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'clinic_type_online' : appointment.clinicName, 'hospital_name' : appointment.projectName, - 'doctor_name' : appointment.doctorName, - 'payment_type' : appointment.patientType, + 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, + 'payment_type' : 'appointment', }); } // R049.3 to_do_list_confirm_appointment(AppoitmentAllHistoryResultList appointment){ logger('to_do_list_confirm_appointment', parameters: { - 'appointment_type' : appointment.appointmentType, + 'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'clinic_type_online' : appointment.clinicName, 'hospital_name' : appointment.projectName, - 'doctor_name' : appointment.doctorName, - 'payment_type' : appointment.patientType, + 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, + 'payment_type' : 'appointment', }); } // R050 to_do_list_check_in(AppoitmentAllHistoryResultList appointment){ logger('to_do_list_check_in', parameters: { - 'appointment_type' : appointment.appointmentType, + 'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'clinic_type_online' : appointment.clinicName, 'hospital_name' : appointment.projectName, - 'doctor_name' : appointment.doctorName, - 'payment_type' : appointment.patientType, + 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, + 'payment_type' : 'appointment', }); } // R051 to_do_list_nfc(AppoitmentAllHistoryResultList appointment){ logger('to_do_list_nfc', parameters: { - 'appointment_type' : appointment.appointmentType, + 'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'clinic_type_online' : appointment.clinicName, 'hospital_name' : appointment.projectName, - 'doctor_name' : appointment.doctorName, - 'payment_type' : appointment.patientType, + 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, + 'payment_type' : 'appointment', }); } // R052 to_do_list_nfc_cancel(AppoitmentAllHistoryResultList appointment){ logger('to_do_list_nfc_cancel', parameters: { - 'appointment_type' : appointment.appointmentType, + 'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'clinic_type_online' : appointment.clinicName, 'hospital_name' : appointment.projectName, - 'doctor_name' : appointment.doctorName, - 'payment_type' : appointment.patientType, + 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, + 'payment_type' : 'appointment', }); } } \ No newline at end of file diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 15906851..3b0d3ecc 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -494,12 +494,15 @@ class _BookSuccessState extends State { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.projectID = widget.patientShareResponse.projectID; appo.clinicID = widget.patientShareResponse.clinicID; + appo.clinicName = widget.patientShareResponse.clinicName; + appo.projectName = widget.patientShareResponse.projectName; appo.appointmentNo = widget.patientShareResponse.appointmentNo; Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) { setState(() {}); }))).then((value) { if (value != null) { + projectViewModel.analytics.appointment.payment_method(appointment_type: 'regular', clinic: widget.docObject.clinicName, payment_method: value, payment_type: 'appointment'); openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); } }); @@ -560,6 +563,10 @@ class _BookSuccessState extends State { service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { String paymentInfo = res['Response_Message']; if (paymentInfo == 'Success') { + String txn_ref = res['Merchant_Reference']; + String amount = res['Amount']; + String payment_method = res['PaymentMethod']; + projectViewModel.analytics.appointment.payment_success(appointment_type: 'regular', payment_method: payment_method, clinic: appo.clinicName, hospital: appo.projectName, txn_amount: "$amount", txn_currency: 'SAR', txn_number: txn_ref); createAdvancePayment(res, appo); } else { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index cc3af6f7..4627c47c 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -934,7 +934,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { print(value); getPatientAppointmentHistory(); - if (value != null) { + if (value != null){ + final appType = appo.isLiveCareAppointment ? 'livecare' : 'regular'; + projectViewModel.analytics.appointment.payment_method(appointment_type: appType, clinic: appo.clinicName, payment_method: value, payment_type: 'appointment'); openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); } }); diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index f306fe09..97c6d3ce 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -1,5 +1,7 @@ import 'dart:io'; +import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; +import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index b145e173..9445e341 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; diff --git a/lib/pages/conference/video-call-web-page.dart b/lib/pages/conference/video-call-web-page.dart new file mode 100644 index 00000000..45a33b3d --- /dev/null +++ b/lib/pages/conference/video-call-web-page.dart @@ -0,0 +1,13 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class VideoCallWebPage extends StatelessWidget{ + + @override + Widget build(BuildContext context) { + return Scaffold( + + ); + } + +} \ No newline at end of file diff --git a/lib/pages/conference/web_rtc/call_home_page_.dart b/lib/pages/conference/web_rtc/call_home_page_.dart index 27fb5919..69161f4c 100644 --- a/lib/pages/conference/web_rtc/call_home_page_.dart +++ b/lib/pages/conference/web_rtc/call_home_page_.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:convert'; import 'package:diplomaticquarterapp/pages/conference/web_rtc/widgets/cam_view_widget.dart'; import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart'; @@ -32,7 +33,7 @@ class _CallHomePageState extends State { //Stream to enable video MediaStream localMediaStream; MediaStream remoteMediaStream; - Signaling signaling = Signaling()..init(); + Signaling signaling = Signaling(); @override void initState() { @@ -44,6 +45,7 @@ class _CallHomePageState extends State { startCall() async{ await _localRenderer.initialize(); await _remoteRenderer.initialize(); + await signaling.init(); final connected = await receivedCall(); } @@ -53,12 +55,29 @@ class _CallHomePageState extends State { localMediaStream = await navigator.mediaDevices.getUserMedia({'video': true, 'audio': true}); _localRenderer.srcObject = localMediaStream; - final connected = await signaling.acceptCall(widget.callerId, widget.receiverId, localMediaStream: localMediaStream, onRemoteMediaStream: (remoteMediaStream){ - setState(() { - this.remoteMediaStream = remoteMediaStream; - _remoteRenderer.srcObject = remoteMediaStream; - }); - }); + final connected = await signaling.acceptCall(widget.callerId, widget.receiverId, localMediaStream: localMediaStream, + onRemoteMediaStream: (remoteMediaStream){ + + // print(remoteMediaStream.toString()); + // print(json.encode(remoteMediaStream.getTracks().asMap())); + this.remoteMediaStream = remoteMediaStream; + _remoteRenderer.srcObject = remoteMediaStream; + _remoteRenderer.addListener(() { + print('_remoteRenderer'); + print(_remoteRenderer); + setState(() {}); + }); + }, + onRemoteTrack: (track){ + _remoteRenderer.srcObject.addTrack(track.track); + // setState(() { + // }); + + print(track.streams.first.getVideoTracks()); + print(track.streams.first.getAudioTracks()); + print(json.encode(track.streams.asMap())); + } + ); if(connected){ signaling.signalR.listen( @@ -88,6 +107,7 @@ class _CallHomePageState extends State { void dispose() { // TODO: implement dispose super.dispose(); + signaling.dispose(); _localRenderer?.dispose(); _remoteRenderer?.dispose(); _audioButton?.close(); diff --git a/lib/pages/webRTC/fcm/FCMSendNotification.dart b/lib/pages/webRTC/fcm/FCMSendNotification.dart index f67537cf..08c4cca9 100644 --- a/lib/pages/webRTC/fcm/FCMSendNotification.dart +++ b/lib/pages/webRTC/fcm/FCMSendNotification.dart @@ -73,7 +73,7 @@ class FCM{ }); return success; - // final response = await http.post('https://fcm.googleapis.com/v1/projects/api-project-815750722565/messages:send', headers:headers, body: body); + // final response = await http.post('https://fcm.googleapis.com/v1/projects/api-project-815750722565/messages:send', headers:he aders, body: body); } diff --git a/lib/pages/webRTC/signaling.dart b/lib/pages/webRTC/signaling.dart index 44de7488..e53779d9 100644 --- a/lib/pages/webRTC/signaling.dart +++ b/lib/pages/webRTC/signaling.dart @@ -9,18 +9,82 @@ typedef void RTCIceGatheringStateCallback(RTCIceGatheringState state); typedef void RTCPeerConnectionStateCallback(RTCPeerConnectionState state); typedef void RTCSignalingStateCallback(RTCSignalingState state); +final Map constraints = { + 'mandatory': {}, + 'optional': [ + {'DtlsSrtpKeyAgreement': true}, + ] +}; + +Map snapsis_ice_config = { + 'iceServers': [ + { "urls": 'stun:15.185.116.59:3478' }, + { "urls": "turn:15.185.116.59:3479", "username": "admin", "credential": "admin" }, + ], + // 'sdpSemantics': 'unified-plan' +}; +Map twilio_ice_config = { + "ice_servers": [ + { + "url": "stun:global.stun.twilio.com:3478?transport=udp", + "urls": "stun:global.stun.twilio.com:3478?transport=udp" + }, + { + "url": "turn:global.turn.twilio.com:3478?transport=udp", + "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", + "urls": "turn:global.turn.twilio.com:3478?transport=udp", + "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" + }, + { + "url": "turn:global.turn.twilio.com:3478?transport=tcp", + "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", + "urls": "turn:global.turn.twilio.com:3478?transport=tcp", + "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" + }, + { + "url": "turn:global.turn.twilio.com:443?transport=tcp", + "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", + "urls": "turn:global.turn.twilio.com:443?transport=tcp", + "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" + } + ], + // 'sdpSemantics': 'unified-plan' +}; +Map google_ice_config = { + 'iceServers': [ + { + 'urls': [ + 'stun:stun.l.google.com:19302', + 'stun:stun1.l.google.com:19302', + 'stun:stun2.l.google.com:19302', + 'stun:stun3.l.google.com:19302' + ] + }, + ], + // 'sdpSemantics': 'unified-plan' +}; +Map aws_ice_config = { + 'iceServers': [ + {'url': "stun:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3478"}, + {'url': "turn:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3479", 'credential': "admin", 'username': "admin"} + ], + // 'sdpSemantics': 'unified-plan' +}; + class Signaling { dispose() { - if (peerConnection != null) peerConnection.dispose(); + if (peerConnection != null) { + peerConnection.dispose(); + peerConnection.getLocalStreams().forEach((e) => e.dispose()); + peerConnection.getRemoteStreams().forEach((e) => e.dispose()); + } signalR.closeConnection(); } - init() { + init() async{ // Create Peer Connection - createPeerConnection(configuration).then((value) { - peerConnection = value; - registerPeerConnectionListeners(); - }); + peerConnection = await createPeerConnection(google_ice_config, constraints); + registerPeerConnectionListeners(); } initializeSignalR(String userName) async { @@ -31,23 +95,6 @@ class Signaling { if (!connected) throw 'Failed to connect SignalR'; } - Map configuration = { - // 'iceServers': [ - // { - // 'urls': ['stun:stun1.l.google.com:19302', 'stun:stun2.l.google.com:19302'] - // } - // ] - - 'iceServers': [ - // { - // 'urls': ['stun:stun1.l.google.com:19302', 'stun:stun2.l.google.com:19302'] - // } - - {'url': "stun:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3478"}, - {'url': "turn:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3479", 'credential': "admin", 'username': "admin"} - ] - }; - SignalRUtil signalR; RTCPeerConnection peerConnection; @@ -65,18 +112,22 @@ class Signaling { // return isCallPlaced; // } - Future acceptCall(String caller, String receiver, {@required MediaStream localMediaStream, @required Function(MediaStream) onRemoteMediaStream}) async { + Future acceptCall(String caller, String receiver, {@required MediaStream localMediaStream, @required Function(MediaStream) onRemoteMediaStream, @required Function(RTCTrackEvent) onRemoteTrack}) async { await initializeSignalR(receiver); signalR.setContributors(caller: caller, receiver: receiver); await signalR.acceptCall(receiver, caller).catchError((e) => throw 'Failed to inform signalR that i accepted a call'); peerConnection.addStream(localMediaStream); + // peerConnection?.onTrack = (track){ + // onRemoteTrack(track); + // }; peerConnection?.onAddStream = (MediaStream stream) { remoteStream = stream; onRemoteMediaStream?.call(stream); }; + return true; } @@ -91,13 +142,23 @@ class Signaling { final receiver = offer['target']; final offerSdp = offer['sdp']; peerConnection.setRemoteDescription(rtcSessionDescriptionFrom(offerSdp)).then((value) { - return peerConnection.createAnswer(); + return peerConnection.createAnswer().catchError((e){ + print(e); + }); }).then((anwser) { - return peerConnection.setLocalDescription(anwser); + return peerConnection.setLocalDescription(anwser).catchError((e){ + print(e); + }); }).then((value) { - return peerConnection.getLocalDescription(); + return peerConnection.getLocalDescription().catchError((e){ + print(e); + }); }).then((answer) { - return signalR.answerOffer(answer, caller, receiver); + return signalR.answerOffer(answer, caller, receiver).catchError((e){ + print(e); + }); + }).catchError((e) { + print(e); }); } @@ -105,42 +166,58 @@ class Signaling { Future createSdpAnswer(String toOfferSdp) async { final offerSdp = rtcSessionDescriptionFrom(jsonDecode(toOfferSdp)); - peerConnection.setRemoteDescription(offerSdp); + peerConnection.setRemoteDescription(offerSdp).catchError((e){ + print(e); + }); - final answer = await peerConnection.createAnswer(); + final answer = await peerConnection.createAnswer().catchError((e){ + print(e); + }); var answerSdp = json.encode(answer); // Send SDP via Push or any channel return answerSdp; } Future createSdpOffer() async { final offer = await peerConnection.createOffer(); - await peerConnection.setLocalDescription(offer); + await peerConnection.setLocalDescription(offer).catchError((e){ + print(e); + }); final map = offer.toMap(); var offerSdp = json.encode(map); // Send SDP via Push or any channel return offerSdp; } addCandidate(String candidateJson) { - peerConnection.addCandidate(rtcIceCandidateFrom(candidateJson)); + peerConnection.addCandidate(rtcIceCandidateFrom(candidateJson)).catchError((e){ + print(e); + }); } void registerPeerConnectionListeners() { + peerConnection.onRenegotiationNeeded = (){ + print('Renegotiation Needed...'); + }; + peerConnection.onIceCandidate = (RTCIceCandidate candidate) { // print(json.encode(candidate.toMap())); - signalR.addIceCandidate(json.encode(candidate.toMap())); + signalR.addIceCandidate(json.encode(candidate.toMap())).catchError((e){ + print(e); + }); }; peerConnection?.onIceGatheringState = (RTCIceGatheringState state) { - // print('ICE gathering state changed: $state'); + print('ICE gathering state changed: $state'); }; peerConnection?.onConnectionState = (RTCPeerConnectionState state) { - // print('Connection state change: $state ${state.index}'); + print('Connection state change: $state'); }; peerConnection?.onSignalingState = (RTCSignalingState state) { - // print('Signaling state change: $state'); + print('Signaling state change: $state'); }; + + } } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 66b9a342..960b6224 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -31,13 +31,13 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';