diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 97fedbd..f61671e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -584,11 +584,12 @@ INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Nightary; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.healthcare-fitness"; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = org.gdsc.snowflowerthon.nightary; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -772,11 +773,12 @@ INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Nightary; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.healthcare-fitness"; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = org.gdsc.snowflowerthon.nightary; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -804,11 +806,12 @@ INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = Nightary; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.healthcare-fitness"; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = org.gdsc.snowflowerthon.nightary; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 5a57514..33022f1 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -32,6 +32,8 @@ "Nightary"가 보다 정확한 수면 질 측정을 위해서는 건강 데이터가 필요해요. NSHealthUpdateUsageDescription "Nightary"가 보다 정확한 수면 질 측정을 위해서는 건강 데이터가 필요해요. + NSMicrophoneUsageDescription + "Nightary"가 보다 정확한 수면 질 측정을 위해서는 마이크 접근 권한이 필요해요. UIApplicationSupportsIndirectInputEvents UIBackgroundModes diff --git a/lib/main.dart b/lib/main.dart index fcb9a92..776fbe7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -25,22 +25,7 @@ void main() async { /* Add Duration 1.0s In Splash Screen */ await Future.delayed(const Duration(seconds: 1)); - await initNotification(); /* Run App */ runApp(const MainApp(initialRoute: Routes.ROOT)); } - -initNotification() async { - final notifications = FlutterLocalNotificationsPlugin(); - - //ios에서 앱 로드시 유저에게 권한요청하려면 - const iosSetting = DarwinInitializationSettings( - requestAlertPermission: true, - requestBadgePermission: true, - requestSoundPermission: true, - ); - - const initializationSettings = InitializationSettings(iOS: iosSetting); - await notifications.initialize(initializationSettings); -} diff --git a/lib/viewModels/setting/setting_viewmodel.dart b/lib/viewModels/setting/setting_viewmodel.dart index b95d2a1..0252b64 100644 --- a/lib/viewModels/setting/setting_viewmodel.dart +++ b/lib/viewModels/setting/setting_viewmodel.dart @@ -48,7 +48,6 @@ class SettingViewModel extends GetxController { updateGoalTime(); updateAlarmTime(); showNotification(); - showNotification2(); } void onChangeAlarmTime(int hour, int minute) { @@ -56,7 +55,7 @@ class SettingViewModel extends GetxController { alarmHour.value = hour; alarmMinute.value = minute; showNotification(); - showNotification2(); + SharedPreferenceFactory.setAlarmTime(hour, minute); }); } @@ -168,6 +167,19 @@ class SettingViewModel extends GetxController { showNotification() async { final notifications = FlutterLocalNotificationsPlugin(); + + //ios에서 앱 로드시 유저에게 권한요청하려면 + const iosSetting = DarwinInitializationSettings( + requestAlertPermission: true, + requestBadgePermission: true, + requestSoundPermission: true, + ); + + const initializationSettings = + InitializationSettings(iOS: iosSetting, macOS: iosSetting); + await notifications.initialize(initializationSettings); + + notifications.initialize(initializationSettings); tz.initializeTimeZones(); var iosDetails = const DarwinNotificationDetails( @@ -175,8 +187,8 @@ class SettingViewModel extends GetxController { presentBadge: true, presentSound: true, ); - - notifications.zonedSchedule( + notifications.cancel(1); + await notifications.zonedSchedule( 1, '오늘의 배터리 양을 확인하세요!', '', @@ -186,27 +198,6 @@ class SettingViewModel extends GetxController { UILocalNotificationDateInterpretation.absoluteTime); } - showNotification2() async { - final notifications = FlutterLocalNotificationsPlugin(); - tz.initializeTimeZones(); - - var iosDetails = const DarwinNotificationDetails( - presentAlert: true, - presentBadge: true, - presentSound: true, - ); - notifications.zonedSchedule( - 2, - '오늘의 배터리 양을 확인하세요!', - '', - makeDate(alarmHour.value, alarmMinute.value, 0), - NotificationDetails(iOS: iosDetails), - uiLocalNotificationDateInterpretation: - UILocalNotificationDateInterpretation.absoluteTime, - matchDateTimeComponents: DateTimeComponents.time, - ); - } - makeDate(int hour, int min, int sec) { var now = tz.TZDateTime.now(tz.local); var when = diff --git a/lib/viewModels/white_noise/white_noise_viewmodel.dart b/lib/viewModels/white_noise/white_noise_viewmodel.dart index 6e46c0e..a3e4c43 100644 --- a/lib/viewModels/white_noise/white_noise_viewmodel.dart +++ b/lib/viewModels/white_noise/white_noise_viewmodel.dart @@ -45,10 +45,6 @@ class WhiteNoiseViewModel extends GetxController { final musics = [ 'assets/data/music_1.mp3', - 'assets/data/music_1.mp3', - 'assets/data/music_1.mp3', - 'assets/data/music_1.mp3', - 'assets/data/music_1.mp3', ]; /* 음악 재생 관련 데이터 */ diff --git a/lib/views/setting/setting_screen.dart b/lib/views/setting/setting_screen.dart index 4975c94..5e641a0 100644 --- a/lib/views/setting/setting_screen.dart +++ b/lib/views/setting/setting_screen.dart @@ -71,7 +71,7 @@ class SettingScreen extends BaseScreen { const SizedBox(height: 14), CardButton(text: "이용약관", onTap: controller.onTapTerm), const SizedBox(height: 14), - CardButton(text: "회원탈퇴", onTap: controller.onTapWithdrawal), + CardButton(text: "데이터 초기화", onTap: controller.onTapWithdrawal), ], ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 3d267b2..4700ab1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: nightary description: Sleep and Liver Care Management Application publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.0.0+1 +version: 1.0.0+4 environment: sdk: '>=3.1.3 <4.0.0' @@ -58,6 +58,7 @@ dependencies: # Extended Nested Scroll View extended_nested_scroll_view: ^6.2.1 + timezone: ^0.9.2 dev_dependencies: