development_haroon_merge_aamir
haroon amjad 2 years ago
parent 3037925016
commit cd4b9d8c74

@ -86,5 +86,7 @@ flutter {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.squareup.okhttp3:okhttp:4.9.1' implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'
} }

@ -73,7 +73,7 @@ class AppNotifications {
if (initialMessage != null) _handleMessage(initialMessage); if (initialMessage != null) _handleMessage(initialMessage);
FirebaseMessaging.onMessage.listen((RemoteMessage message) { FirebaseMessaging.onMessage.listen((RemoteMessage message) {
if (message.notification != null) _handleMessage(message); _handleMessage(message);
}); });
FirebaseMessaging.onMessageOpenedApp.listen(_handleOpenApp); FirebaseMessaging.onMessageOpenedApp.listen(_handleOpenApp);
@ -134,23 +134,26 @@ class AppNotifications {
Utils.saveStringFromPrefs("isAppOpendByChat", "false"); Utils.saveStringFromPrefs("isAppOpendByChat", "false");
GetNotificationsResponseModel notification = GetNotificationsResponseModel(); GetNotificationsResponseModel notification = GetNotificationsResponseModel();
notification.createdOn = DateUtil.getMonthDayYearDateFormatted(DateTime.now()); if (message.notification != null) {
notification.messageTypeData = message.data['picture']; notification.createdOn = DateUtil.getMonthDayYearDateFormatted(DateTime.now());
notification.message = message.data['message']; notification.messageTypeData = message.data['picture'];
notification.notificationType = message.data["NotificationType"].toString(); notification.message = message.data['message'];
if (message.data["NotificationType"] == "2") { notification.notificationType = message.data["NotificationType"].toString();
notification.videoURL = message.data["VideoUrl"]; if (message.data["NotificationType"] == "2") {
} notification.videoURL = message.data["VideoUrl"];
}
Future.delayed(Duration(seconds: 5), () { Future.delayed(Duration(seconds: 5), () {
Navigator.of(context).push( Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => NotificationsDetailsPage( builder: (BuildContext context) => NotificationsDetailsPage(
notification: notification, notification: notification,
),
), ),
), );
); });
}); }
if (message.data.isNotEmpty && message.data["messageType"] == 'chat') { if (message.data.isNotEmpty && message.data["messageType"] == 'chat') {
Utils.saveStringFromPrefs("isAppOpendByChat", "true"); Utils.saveStringFromPrefs("isAppOpendByChat", "true");
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString()); Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
@ -187,8 +190,6 @@ class AppNotifications {
}); });
} }
} }
} }
const AndroidNotificationChannel channel = AndroidNotificationChannel( const AndroidNotificationChannel channel = AndroidNotificationChannel(

@ -154,7 +154,7 @@ class _StartCallPageState extends State<StartCallPage> {
RTCVideoView( RTCVideoView(
provider.remoteRenderer!, provider.remoteRenderer!,
objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitContain, objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitContain,
filterQuality: FilterQuality.high, // filterQuality: FilterQuality.high,
key: const Key('remote'), key: const Key('remote'),
), ),
if (provider.isVideoCall) if (provider.isVideoCall)
@ -174,7 +174,7 @@ class _StartCallPageState extends State<StartCallPage> {
child: RTCVideoView( child: RTCVideoView(
provider.localVideoRenderer!, provider.localVideoRenderer!,
mirror: true, mirror: true,
filterQuality: FilterQuality.high, // filterQuality: FilterQuality.high,
objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitCover, objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitCover,
), ),
), ),

@ -98,8 +98,10 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver {
void setupVoIPCallBacks() { void setupVoIPCallBacks() {
if (Platform.isIOS) { if (Platform.isIOS) {
voIPKit.getVoIPToken().then((String? value) async { voIPKit.getVoIPToken().then((String? value) async {
print('🎈 example: getVoIPToken: $value');
if (value != null) { if (value != null) {
AppState().setiosVoipPlayerID = await ChatApiClient().oneSignalVoip(value!); AppState().setiosVoipPlayerID = await ChatApiClient().oneSignalVoip(value!);
print('🎈 example: OneSignal ID: ${AppState().iosVoipPlayerID}');
} }
}); });
} }
@ -150,8 +152,11 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver {
isIncomingCall = true; isIncomingCall = true;
if (AppState().getisUserOnline) { if (AppState().getisUserOnline) {
_iosCallPayload = IosCallPayload( _iosCallPayload = IosCallPayload(
uuid: uuid, incomingCallerId: callDetails.split("-")[0], incomingCallReciverId: callDetails.split("-")[1], incomingCallerName: _iosCallPayload!.incomingCallerName, incomingCallType: callDetails.split("-").last); uuid: uuid,
incomingCallerId: callDetails.split("-")[0],
incomingCallReciverId: callDetails.split("-")[1],
incomingCallerName: _iosCallPayload!.incomingCallerName,
incomingCallType: callDetails.split("-").last);
} else { } else {
_iosCallPayload = IosCallPayload( _iosCallPayload = IosCallPayload(
uuid: uuid, incomingCallerId: callDetails.split("-")[0], incomingCallReciverId: callDetails.split("-")[1], incomingCallerName: null, incomingCallType: callDetails.split("-").last); uuid: uuid, incomingCallerId: callDetails.split("-")[0], incomingCallReciverId: callDetails.split("-")[1], incomingCallerName: null, incomingCallType: callDetails.split("-").last);
@ -398,6 +403,7 @@ class _LoginScreenState extends State<LoginScreen> with WidgetsBindingObserver {
Utils.showLoading(context); Utils.showLoading(context);
Future.delayed(Duration(seconds: Platform.isIOS ? 3 : 2)).whenComplete(() { Future.delayed(Duration(seconds: Platform.isIOS ? 3 : 2)).whenComplete(() {
if (!isIncomingCall) { if (!isIncomingCall) {
Utils.hideLoading(context);
if (isAppOpenBySystem!) checkFirebaseToken(); if (isAppOpenBySystem!) checkFirebaseToken();
} }
}); });

@ -76,7 +76,7 @@ class _OffersAndDiscountsDetailsState extends State<OffersAndDiscountsDetails> {
: getOffersList[0].titleEn!.toText22(isBold: true, color: const Color(0xff2B353E)).center, : getOffersList[0].titleEn!.toText22(isBold: true, color: const Color(0xff2B353E)).center,
Html( Html(
data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "", data: AppState().isArabic(context) ? getOffersList[0].descriptionAr! : getOffersList[0].descriptionEn ?? "",
onLinkTap: (String? url, Map<String, String> attributes, _) { onLinkTap: (String? url, RenderContext context, Map<String, String> attributes, _) {
launchUrl(Uri.parse(url!)); launchUrl(Uri.parse(url!));
}, },
), ),

Loading…
Cancel
Save