diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 7d74b94..c1c9fd9 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -1,6 +1,6 @@ import UIKit import Flutter -import flutter_local_notifications +import Firebase @UIApplicationMain @@ -9,13 +9,7 @@ import flutter_local_notifications _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in - GeneratedPluginRegistrant.register(with: registry) - } - - if #available(iOS 10.0, *) { - UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate - } + FirebaseApp.configure() GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index f8d7b49..15e0a0c 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -42,14 +42,16 @@ This App requires access to your location to mark your attendance. NSLocationWhenInUseUsageDescription This App requires access to your location to mark your attendance. - NSPhotoLibraryUsageDescription - This app requires photo library access to select image as document & upload it. NSMicrophoneUsageDescription This app requires microphone access to for call. + NSPhotoLibraryUsageDescription + This app requires photo library access to select image as document & upload it. UIBackgroundModes remote-notification + FirebaseAppDelegateProxyEnabled + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -69,13 +71,13 @@ UIViewControllerBasedStatusBarAppearance - com.apple.developer.nfc.readersession.formats - - TAG - com.apple.developer.nfc.readersession.felica.systemcodes 0000 + com.apple.developer.nfc.readersession.formats + + TAG + diff --git a/lib/api/chat/chat_api_client.dart b/lib/api/chat/chat_api_client.dart index d029866..3ad0ed7 100644 --- a/lib/api/chat/chat_api_client.dart +++ b/lib/api/chat/chat_api_client.dart @@ -30,12 +30,11 @@ class ChatApiClient { { "employeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(), "password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG", - "isMobile": true, - "deviceToken": AppState().deviceNotificationToken + "isMobile": true, + "deviceToken": AppState().deviceNotificationToken }, ); - if (!kReleaseMode) { logger.i("login-res: " + response.body); } diff --git a/lib/classes/notifications.dart b/lib/classes/notifications.dart index 649b757..b7d7988 100644 --- a/lib/classes/notifications.dart +++ b/lib/classes/notifications.dart @@ -15,25 +15,25 @@ class AppNotifications { factory AppNotifications() => _instance; - Future requestPermissions() async { - if (Platform.isIOS) { - // await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions(alert: true, badge: true, sound: true); - } else if (Platform.isAndroid) { - // AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation(); - // bool? granted = await androidImplementation?.requestPermission(); - // if (granted == false) { - // print("-------------------- Permission Granted ------------------------"); - // print(granted); - // await Permission.notification.request(); - // } - } - } - - Future isAndroidPermGranted() async { - if (Platform.isAndroid) { - // bool granted = await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.areNotificationsEnabled() ?? false; - } - } + // Future requestPermissions() async { + // if (Platform.isIOS) { + // await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions(alert: true, badge: true, sound: true); + // } else if (Platform.isAndroid) { + // AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation(); + // bool? granted = await androidImplementation?.requestPermission(); + // if (granted == false) { + // print("-------------------- Permission Granted ------------------------"); + // print(granted); + // await Permission.notification.request(); + // } + // } + // } + + // Future isAndroidPermGranted() async { + // if (Platform.isAndroid) { + // bool granted = await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.areNotificationsEnabled() ?? false; + // } + // } void initNotification(String? firebaseToken) async { // await requestPermissions(); diff --git a/lib/provider/chat_provider_model.dart b/lib/provider/chat_provider_model.dart index c0a16c0..71d7ccb 100644 --- a/lib/provider/chat_provider_model.dart +++ b/lib/provider/chat_provider_model.dart @@ -1415,17 +1415,17 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { void inputBoxDirection(String val) { if (val.isNotEmpty) { isTextMsg = true; + RegExp exp = RegExp("[a-zA-Z]"); + if (exp.hasMatch(val.substring(val.length - 1)) && val.substring(val.length - 1) != " ") { + textDirection = Material.TextDirection.ltr; + notifyListeners(); + } else if (val.substring(val.length - 1) != " " && !exp.hasMatch(val.substring(val.length - 1))) { + textDirection = Material.TextDirection.rtl; + notifyListeners(); + } } else { isTextMsg = false; } - RegExp exp = RegExp("[a-zA-Z]"); - if (exp.hasMatch(val.substring(val.length - 1)) && val.substring(val.length - 1) != " ") { - textDirection = Material.TextDirection.ltr; - notifyListeners(); - } else if (val.substring(val.length - 1) != " " && !exp.hasMatch(val.substring(val.length - 1))) { - textDirection = Material.TextDirection.rtl; - notifyListeners(); - } } Material.TextDirection getTextDirection(String v) { diff --git a/lib/ui/chat/chat_detailed_screen.dart b/lib/ui/chat/chat_detailed_screen.dart index da547cf..a72e12b 100644 --- a/lib/ui/chat/chat_detailed_screen.dart +++ b/lib/ui/chat/chat_detailed_screen.dart @@ -256,7 +256,10 @@ class _ChatDetailScreenState extends State { textDirection: m.textDirection, controller: m.message, decoration: InputDecoration( - hintText: m.isAttachmentMsg ? m.selectedFile.path.split("/").last : LocaleKeys.typeheretoreply.tr(), + hintTextDirection: m.textDirection, + hintText: m.isAttachmentMsg + ? m.selectedFile.path.split("/").last + : m.textDirection.name == "rtl" ? "اكتب هنا للرد" :LocaleKeys.typeheretoreply.tr(), hintStyle: TextStyle(color: m.isAttachmentMsg ? MyColors.darkTextColor : MyColors.grey98Color, fontSize: 14), border: InputBorder.none, focusedBorder: InputBorder.none, diff --git a/pubspec.yaml b/pubspec.yaml index c343421..b3d6c4c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -108,7 +108,7 @@ dependencies: dependency_overrides: - #firebase_core_platform_interface: 4.5.1 + firebase_core_platform_interface: 4.5.1 dev_dependencies: