Skip to content

feat: health 라이브러리 연결 외 3건#194

Merged
surfwithus merged 4 commits intomainfrom
feat/health
Aug 27, 2025
Merged

feat: health 라이브러리 연결 외 3건#194
surfwithus merged 4 commits intomainfrom
feat/health

Conversation

@surfwithus
Copy link
Collaborator

@surfwithus surfwithus commented Aug 27, 2025

Important

Integrate Health library for iOS, update deployment target, and enhance UI to display Health data.

  • iOS Configuration:
    • Update MinimumOSVersion to 14.0 in AppFrameworkInfo.plist and project.pbxproj.
    • Add Podfile and Podfile.lock for CocoaPods dependencies, including health library.
    • Update Runner.entitlements to include HealthKit permissions.
  • Health Data Integration:
    • Add HealthDataService in health_data_service.dart for managing Health data access and permissions.
    • Initialize Health data in main.dart and handle permissions.
  • UI Updates:
    • Update FamilyStepTrackerScreen to display and update step data using Health data.
    • Modify HealthHomeScreen to fetch and display today's steps using Health data.

This description was created by Ellipsis for cda34e0. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • 신기능
    • iOS 건강 데이터(HealthKit) 연동: 기기 걸음수 자동 반영 및 30초 단위 실시간 업데이트.
    • 가족 걸음수 화면에서 내 기기 걸음수가 자동 병합/업로드.
  • 변경사항
    • iOS 최소 지원 버전 14.0으로 상향.
    • 오늘 걸음수 계산이 사용자별 데이터 기준으로 정교화.
    • 총 걸음수 표시 가독성 개선(천 단위 구분).
    • 권한 안내 추가/갱신: 건강 데이터, 카메라, 위치, 마이크, 사진, 로컬 네트워크 등.
    • 백그라운드 갱신 및 푸시 알림 모드 설정 반영.
  • 작업
    • iOS 프로젝트 및 빌드 설정 정비(CocoaPods/팀 설정 등).

@coderabbitai
Copy link

coderabbitai bot commented Aug 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

iOS 타겟을 14.0으로 상향하고, Podfile을 추가해 Flutter iOS 통합을 설정했습니다. Info.plist/Entitlements에 HealthKit 및 권한 키를 정리·추가했습니다. Flutter에 HealthDataService를 신설하고 앱 시작 및 건강 관련 화면에 통합하여 사용자 걸음 수를 읽고 서버 데이터와 병합·업데이트합니다. pubspec에 health 의존성을 추가했습니다.

Changes

Cohort / File(s) Summary
iOS 배포 타겟/프로젝트 설정
frontend/ongi/ios/Flutter/AppFrameworkInfo.plist, frontend/ongi/ios/Runner.xcodeproj/project.pbxproj
iOS Minimum/Deployment Target 13.0 → 14.0로 상향. Xcode 프로젝트의 DEVELOPMENT_TEAM 값 갱신.
iOS CocoaPods 통합
frontend/ongi/ios/Podfile
새 Podfile 추가. 플랫폼 ios 14.0, CocoaPods 분석 비활성화, Flutter podhelper 로드, Runner/RunnerTests 타깃 설정 및 post_install 훅 구성.
iOS 앱 권한/엔타이틀먼트
frontend/ongi/ios/Runner/Info.plist, frontend/ongi/ios/Runner/Runner.entitlements
Info.plist 구조 정리 및 Health/네트워크/위치/미디어 등 권한 문구/키 추가·수정. ATS 간소화. HealthKit 엔타이틀먼트 추가(healthkit, healthkit.access).
헬스 데이터 서비스 추가
frontend/ongi/lib/services/health_data_service.dart
Health 플러그인을 감싼 싱글턴 서비스 신설. 초기화, 권한 확인/요청, 날짜/범위별 걸음 수 조회, 오늘/현재 걸음 수 API 제공.
앱 시작 시 초기화 연동
frontend/ongi/lib/main.dart
HealthDataService를 임포트하고 시작 시 _initializeHealthData() 호출 추가. 예외 로깅.
건강 화면 통합: 가족 걸음 트래커
frontend/ongi/lib/screens/health/family_step_tracker_screen.dart
HealthDataService 연동, 권한 체크, 오늘 걸음 수 주기적 갱신 타이머(30초), 서버 데이터와의 병합/업로드 로직 추가. 총합/정렬 갱신. const 생성자 추가.
건강 홈 화면 로딩 로직 조정
frontend/ongi/lib/screens/health/health_home_screen.dart
서버 응답의 memberSteps에서 현재 사용자 ID 매칭 시 그 값으로 todaySteps 결정; 없으면 종전 필드로 폴백.
의존성 추가
frontend/ongi/pubspec.yaml
dependencies에 health: ^13.1.2 추가.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User as 사용자
  participant App as Flutter App
  participant HDS as HealthDataService
  participant Health as OS Health(HealthKit)
  participant Server as API 서버

  User->>App: 앱 실행
  App->>HDS: setupHealthData()
  HDS->>HDS: initialize()
  HDS->>Health: 권한 보유 확인(hasPermissions)
  alt 권한 미보유
    HDS->>Health: 권한 요청(requestPermissions)
    Health-->>HDS: 승인/거부
  end
  App-->>User: 초기화 완료 로그(성공/실패)
Loading
sequenceDiagram
  autonumber
  participant Screen as FamilyStepTrackerScreen
  participant HDS as HealthDataService
  participant Server as API 서버

  Screen->>HDS: 초기화 및 권한 확인
  alt 권한 허용됨
    Screen->>HDS: getStepsForDate(오늘)
    HDS-->>Screen: deviceSteps(오늘)
    Screen->>Server: 오늘 deviceSteps 업로드
    loop 30초 간격
      Screen->>HDS: getStepsForDate(오늘)
      HDS-->>Screen: 최신 deviceSteps
      Screen->>Screen: 멤버 리스트 병합/정렬/총합 갱신
      Screen->>Server: deviceSteps 업로드
    end
  else 권한 없음
    Screen-->>Screen: 서버 데이터만 표시
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

토끼 발자국 톡톡, 오늘도 카운트 업!
헬스킷 문 살짝, 허락을 톡 두드려요.
폰 속 걸음과 서버의 합창, 착착—
가족 순위표도 살짝 뒤바뀌고 🐾
iOS는 14로, 우리는 앞으로!

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2b64d37 and cda34e0.

⛔ Files ignored due to path filters (1)
  • frontend/ongi/ios/Podfile.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • frontend/ongi/ios/Flutter/AppFrameworkInfo.plist (1 hunks)
  • frontend/ongi/ios/Podfile (1 hunks)
  • frontend/ongi/ios/Runner.xcodeproj/project.pbxproj (6 hunks)
  • frontend/ongi/ios/Runner/Info.plist (1 hunks)
  • frontend/ongi/ios/Runner/Runner.entitlements (1 hunks)
  • frontend/ongi/lib/main.dart (3 hunks)
  • frontend/ongi/lib/screens/health/family_step_tracker_screen.dart (8 hunks)
  • frontend/ongi/lib/screens/health/health_home_screen.dart (1 hunks)
  • frontend/ongi/lib/services/health_data_service.dart (1 hunks)
  • frontend/ongi/pubspec.yaml (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/health

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@surfwithus surfwithus merged commit 2d0f527 into main Aug 27, 2025
2 of 4 checks passed
@surfwithus surfwithus deleted the feat/health branch August 27, 2025 08:57
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to cda34e0 in 1 minute and 57 seconds. Click for details.
  • Reviewed 1089 lines of code in 11 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/ongi/lib/screens/health/family_step_tracker_screen.dart:272
  • Draft comment:
    Ensure that the 'firstOrNull' method is available (e.g. via package:collection) since it’s not a standard List method.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the author to ensure the availability of a method, which is against the rules. It doesn't provide a specific suggestion or ask for a test to be written. It is more of a reminder or a prompt to double-check something, which is not allowed.
2. frontend/ongi/lib/services/health_data_service.dart:125
  • Draft comment:
    The getDetailedStepsData method currently returns an empty list; if detailed step data is needed, consider implementing it or add a comment that it's not supported.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
3. frontend/ongi/ios/Runner/Info.plist:36
  • Draft comment:
    NSAppTransportSecurity is configured to allow arbitrary loads. Ensure this relaxed setting is acceptable for production.
  • Reason this comment was not posted:
    Comment was on unchanged code.
4. frontend/ongi/ios/Runner/Runner.entitlements:9
  • Draft comment:
    'com.apple.developer.healthkit.access' is set to an empty array. Confirm if this is intentional or if specific access types should be declared.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This comment violates several rules. It's asking for confirmation of intention ("Confirm if this is intentional..."). It's speculative since it's not stating a definite issue. Without deep knowledge of HealthKit requirements, we can't be certain if an empty array is problematic. The author likely configured this intentionally as part of enabling HealthKit. Maybe an empty HealthKit access array could cause runtime issues if specific permissions are required. The comment might be trying to prevent a potential bug. Even if specific permissions might be needed later, that would be caught during testing or runtime. This is a configuration choice that the author made deliberately, and we should trust their judgment without asking for confirmation. Delete this comment as it violates our rules by asking for confirmation of intention and making a speculative suggestion without clear evidence of an actual problem.
5. frontend/ongi/ios/Runner.xcodeproj/project.pbxproj:496
  • Draft comment:
    The DEVELOPMENT_TEAM ID has been updated (from a previous value to '55D5UTU9R9'). Verify that this change is intentional for your build configuration.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify if the change is intentional, which is against the rules. It doesn't provide a specific suggestion or point out a potential issue with the code itself. Therefore, it should be removed.

Workflow ID: wflow_mdxvb4Cf2X3I9LEe

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

_totalSteps += difference;

// 현재 사용자의 걸음 수 업데이트
final currentUserInfo = PrefsManager.getUserInfo();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider refactoring async code: use await instead of chaining .then() for PrefsManager.getUserInfo() for clearer state updates.

Neibce pushed a commit to 2025-PNU-SW-Hackathon/PNUSW-2025-OnGi-10 that referenced this pull request Aug 28, 2025
* feat: health 라이브러리 연결

* fix: 권한 요청 위치 변경 및 UI 수정

* fix: 권한 오작동 해결

* feat: 건강 기록 메인 화면에서 총 걸음 수가 아닌 유저 걸음 수로 표시되게 수정
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant