Skip to content

Commit

Permalink
Merge pull request #35 from halfmoon-mind/develop
Browse files Browse the repository at this point in the history
feat : 화이트노이즈 캐러셀 비활성화
  • Loading branch information
halfmoon-mind authored Jan 12, 2024
2 parents a25c977 + 41aa3be commit 969a985
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 49 deletions.
9 changes: 6 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<string>"Nightary"가 보다 정확한 수면 질 측정을 위해서는 건강 데이터가 필요해요.</string>
<key>NSHealthUpdateUsageDescription</key>
<string>"Nightary"가 보다 정확한 수면 질 측정을 위해서는 건강 데이터가 필요해요.</string>
<key>NSMicrophoneUsageDescription</key>
<string>"Nightary"가 보다 정확한 수면 질 측정을 위해서는 마이크 접근 권한이 필요해요.</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UIBackgroundModes</key>
Expand Down
15 changes: 0 additions & 15 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
41 changes: 16 additions & 25 deletions lib/viewModels/setting/setting_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ class SettingViewModel extends GetxController {
updateGoalTime();
updateAlarmTime();
showNotification();
showNotification2();
}

void onChangeAlarmTime(int hour, int minute) {
debouncer.run(() {
alarmHour.value = hour;
alarmMinute.value = minute;
showNotification();
showNotification2();

SharedPreferenceFactory.setAlarmTime(hour, minute);
});
}
Expand Down Expand Up @@ -168,15 +167,28 @@ 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(
presentAlert: true,
presentBadge: true,
presentSound: true,
);

notifications.zonedSchedule(
notifications.cancel(1);
await notifications.zonedSchedule(
1,
'오늘의 배터리 양을 확인하세요!',
'',
Expand All @@ -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 =
Expand Down
4 changes: 0 additions & 4 deletions lib/viewModels/white_noise/white_noise_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

/* 음악 재생 관련 데이터 */
Expand Down
2 changes: 1 addition & 1 deletion lib/views/setting/setting_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class SettingScreen extends BaseScreen<SettingViewModel> {
const SizedBox(height: 14),
CardButton(text: "이용약관", onTap: controller.onTapTerm),
const SizedBox(height: 14),
CardButton(text: "회원탈퇴", onTap: controller.onTapWithdrawal),
CardButton(text: "데이터 초기화", onTap: controller.onTapWithdrawal),
],
),
),
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -58,6 +58,7 @@ dependencies:

# Extended Nested Scroll View
extended_nested_scroll_view: ^6.2.1
timezone: ^0.9.2


dev_dependencies:
Expand Down

0 comments on commit 969a985

Please sign in to comment.