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 210106e..3ad0ed7 100644 --- a/lib/api/chat/chat_api_client.dart +++ b/lib/api/chat/chat_api_client.dart @@ -29,9 +29,9 @@ class ChatApiClient { "${ApiConsts.chatLoginTokenUrl}externaluserlogin", { "employeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER.toString(), - "password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG" - // "isMobile": true, - // "deviceToken": AppState().deviceNotificationToken + "password": "FxIu26rWIKoF8n6mpbOmAjDLphzFGmpG", + "isMobile": true, + "deviceToken": AppState().deviceNotificationToken }, ); 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();