merge-requests/581/merge
haroon amjad 3 years ago
parent 4ba229c436
commit 11529c65c5

@ -727,6 +727,9 @@ var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL =
var GET_TAMARA_PLAN =
'https://mdlaboratories.com/tamara/Home/GetInstallments';
var GET_ONESIGNAL_VOIP_TOKEN =
'https://onesignal.com/api/v1/players';
class AppGlobal {
static var context;

@ -3,6 +3,7 @@ const APP_LANGUAGE = 'language';
const USER_PROFILE = 'user-profile';
const PUSH_TOKEN = 'push-token';
const APNS_TOKEN = 'apns-token';
const ONESIGNAL_APNS_TOKEN = 'onesignal-apns-token';
const REGISTER_DATA_FOR_REGISTER = 'register-data-for-register';
const LOGIN_TOKEN_ID = 'register-data-for-register';
const REGISTER_DATA_FOR_LOGIIN = 'register-data-for-login';

@ -6,6 +6,7 @@ class ApplePayInsertRequest {
int customerID;
String customerName;
String deviceToken;
String voipToken;
int doctorID;
String projectID;
String serviceID;
@ -43,6 +44,7 @@ class ApplePayInsertRequest {
this.customerID,
this.customerName,
this.deviceToken,
this.voipToken,
this.doctorID,
this.projectID,
this.serviceID,
@ -80,6 +82,7 @@ class ApplePayInsertRequest {
customerID = json['CustomerID'];
customerName = json['CustomerName'];
deviceToken = json['DeviceToken'];
voipToken = json['VoipToken'];
doctorID = json['DoctorID'];
projectID = json['ProjectID'];
serviceID = json['Service_ID'];
@ -119,6 +122,7 @@ class ApplePayInsertRequest {
data['CustomerID'] = this.customerID;
data['CustomerName'] = this.customerName;
data['DeviceToken'] = this.deviceToken;
data['VoipToken'] = this.voipToken;
data['DoctorID'] = this.doctorID;
data['ProjectID'] = this.projectID;
data['Service_ID'] = this.serviceID;

@ -24,7 +24,7 @@ class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
initialVideoId: getVideoURL(),
flags: YoutubePlayerFlags(
autoPlay: true,
mute: true,
mute: false,
),
);
super.initState();
@ -48,10 +48,12 @@ class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
}
String getVideoURL() {
String videoId;
videoId = YoutubePlayer.convertUrlToId(widget.notification.videoURL);
print(videoId); // BBAyRBTfsOU
return videoId;
if (widget.notification.videoURL != null && widget.notification.notificationType == "2") {
String videoId;
videoId = YoutubePlayer.convertUrlToId(widget.notification.videoURL);
print(videoId); // BBAyRBTfsOU
return videoId;
}
}
@override

@ -17,10 +17,10 @@ import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart';
import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family;
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
@ -40,7 +40,6 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app_icon_badge/flutter_app_icon_badge.dart';
import 'package:flutter_ios_voip_kit/call_state_type.dart';
import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_svg/flutter_svg.dart';
@ -449,8 +448,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}
}
dummyCall() async {
final json = {
"callerID": "s1",
@ -459,7 +456,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
"notfID": "123",
"notification_foreground": "true",
"count": "1",
"message": "Doctor is calling ",
"AppointmentNo": "123",
"title": "Rayyan Hospital",
@ -473,7 +469,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
"appointmenttime": "09:00",
"type": "video",
"session_id":
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0LTE1OTg3NzQ1MDYiLCJpc3MiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0Iiwic3ViIjoiQUNhYWQ1YTNmOGM2NGZhNjczNTY3NTYxNTc0N2YyNmMyYiIsImV4cCI6MTU5ODc3ODEwNiwiZ3JhbnRzIjp7ImlkZW50aXR5IjoiSGFyb29uMSIsInZpZGVvIjp7InJvb20iOiJTbWFsbERhaWx5U3RhbmR1cCJ9fX0.7XUS5uMQQJfkrBZu9EjQ6STL6R7iXkso6BtO1HmrQKk",
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0LTE1OTg3NzQ1MDYiLCJpc3MiOiJTS2I2NjYyOWMzN2ZhOTM3YjFjNDI2Zjg1MTgyNWFmN2M0Iiwic3ViIjoiQUNhYWQ1YTNmOGM2NGZhNjczNTY3NTYxNTc0N2YyNmMyYiIsImV4cCI6MTU5ODc3ODEwNiwiZ3JhbnRzIjp7ImlkZW50aXR5IjoiSGFyb29uMSIsInZpZGVvIjp7InJvb20iOiJTbWFsbERhaWx5U3RhbmR1cCJ9fX0.7XUS5uMQQJfkrBZu9EjQ6STL6R7iXkso6BtO1HmrQKk",
"identity": "Haroon1",
"name": "SmallDailyStandup",
"videoUrl": "video",
@ -703,6 +699,17 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} else {
projectViewModel.analytics.setUser(null);
}
String voipToken = await sharedPref.getString(APNS_TOKEN);
getOneSignalVOIPToken(voipToken);
}
getOneSignalVOIPToken(String voipToken) {
LiveCareService service = new LiveCareService();
service.getOneSignalVOIPToken(voipToken, context).then((res) {
AppSharedPreferences().setString(ONESIGNAL_APNS_TOKEN, res['id']);
}).catchError((err) {
print(err);
});
}
void showUserConsent() {

@ -201,7 +201,7 @@ class LiveCareService extends BaseService {
Map<String, dynamic> request;
String deviceToken;
String voipToken = await sharedPref.getString(APNS_TOKEN);
String voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
getDeviceToken().then((value) {
print(value);
deviceToken = value;
@ -314,4 +314,19 @@ class LiveCareService extends BaseService {
return Future.value(localRes);
}
Future<Map> getOneSignalVOIPToken(String voipToken, BuildContext context) async {
Map<String, dynamic> request;
// request = {"app_id": "eb8e49e5-dec7-4ed2-8d6a-4df8cb301406", "identifier": voipToken, "device_type": 0, "test_type": 0};
request = { "app_id": "eb8e49e5-dec7-4ed2-8d6a-4df8cb301406", "identifier": voipToken, "device_type": 0 };
dynamic localRes;
await baseAppClient.post(GET_ONESIGNAL_VOIP_TOKEN, isExternal: true, isAllowAny: true, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
}

@ -44,8 +44,8 @@ class _SplashScreenState extends State<SplashScreen> {
AppSharedPreferences().getAll().then((value){
debugPrint("ALL SHARED PREFERENCES!!!!!");
debugPrint(jsonEncode(value));
// debugPrint("ALL SHARED PREFERENCES!!!!!");
// debugPrint(jsonEncode(value));
});
}

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notificatio
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/webRTC/OpenTok/OpenTok.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app-permissions.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:firebase_messaging/firebase_messaging.dart';

@ -26,11 +26,7 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
applePayAPIEnabled: true,
)),
crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black),
ios: IOSInAppBrowserOptions(
hideToolbarBottom: true,
toolbarBottomBackgroundColor: Colors.white,
presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN
));
ios: IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN));
class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType;
@ -168,6 +164,7 @@ class MyInAppBrowser extends InAppBrowser {
applePayInsertRequest.customerID = authenticatedUser.patientID;
applePayInsertRequest.customerName = authenticatedUser.firstName;
applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
applePayInsertRequest.doctorID = (doctorID != null && doctorID != "") ? doctorID : 0;
applePayInsertRequest.projectID = projId;
applePayInsertRequest.serviceID = servID;
@ -254,8 +251,8 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('PATIENT_OUT_SA', authUser.outSA == 0 ? false.toString() : true.toString());
form = form.replaceFirst('PATIENT_TYPE_ID', patientData == null ? patientType.toString() : "1");
// form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN) + "," + await sharedPref.getString(APNS_TOKEN));
form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN));
form = form.replaceFirst('DEVICE_TOKEN', await AppSharedPreferences().getString(PUSH_TOKEN) + "," + await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN));
// form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN));
form = form.replaceFirst('LATITUDE_VALUE', this.lat.toString());
form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString());

@ -1,7 +1,7 @@
name: diplomaticquarterapp
description: A new Flutter application.
version: 4.4.98+404098
version: 4.4.99+404099
environment:
sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save