Skip to content

feat: fcm 알림 약 복용 체크용 커스텀 액션 추가#177

Merged
Neibce merged 2 commits intomainfrom
fe/feat/fcm-custom-action
Aug 21, 2025
Merged

feat: fcm 알림 약 복용 체크용 커스텀 액션 추가#177
Neibce merged 2 commits intomainfrom
fe/feat/fcm-custom-action

Conversation

@Neibce
Copy link
Owner

@Neibce Neibce commented Aug 21, 2025

Summary by CodeRabbit

  • 신기능
    • 복약 리마인더 푸시 알림 지원: 일정 시간에 미복용 시 자동 알림 발송.
    • iOS 전면 표시 지원: 앱 사용 중에도 배너·배지·사운드로 알림 표시.
    • 알림 액션 추가: iOS에서 “복용 완료!” 빠른 처리.
    • 앱 시작 시 로컬 알림 초기화로 알림 신뢰성 및 도달성 개선.
    • 안드로이드 알림 사운드 적용 및 표시 동작 개선.
  • 작업
    • 로컬 알림 플러그인 의존성 추가.

@coderabbitai
Copy link

coderabbitai bot commented Aug 21, 2025

Walkthrough

백엔드에 복약 알림 스케줄러와 FCM 푸시 발송 로직이 추가되고, 특정 알약 삭제 시 복용 기록 일괄 삭제가 포함되었습니다. 저장소 레벨에 조회/삭제 메서드가 확장되었습니다. 프런트엔드는 Flutter Local Notifications를 도입하여 iOS 전경 표시 및 알림 액션 카테고리를 초기화했습니다. 의존성에 플러그인이 추가되었습니다.

Changes

Cohort / File(s) Summary
Repo 확장 (기록 조회/삭제)
backend/ongi/src/main/java/ongi/pill/repository/PillIntakeRecordRepository.java
메서드 추가: findByIntakeDate(LocalDate), deleteByPill(Pill)
서비스 알림/스케줄링/삭제 연동
backend/ongi/src/main/java/ongi/pill/service/PillService.java
FCM 발송 로직, 사용자 FCM 토큰 조회 의존성 추가, 매분 스케줄 작업 checkAndSendMedicationAlarms() 추가, 알약 삭제 시 관련 복용 기록 삭제
Flutter 알림 초기화
frontend/ongi/lib/main.dart
Flutter Local Notifications 초기화, iOS 전경 표시 옵션 설정, iOS 카테고리/액션(PILL_TAKE_REMINDER, ACCEPT) 등록, 콜백 바인딩
의존성 추가
frontend/ongi/pubspec.yaml
flutter_local_notifications: ^19.4.0 의존성 추가

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Cron as Scheduler (매 분)
  participant PS as PillService
  participant PIR as PillIntakeRecordRepository
  participant UTR as UserFcmTokenRepository
  participant FCM as FirebaseMessaging
  Cron->>PS: checkAndSendMedicationAlarms()
  PS->>PIR: 오늘 미복용(시간 경과) 기록 조회/검증
  PS->>UTR: 사용자 FCM 토큰 조회
  loop 각 알림 대상
    PS->>FCM: Message 전송 (Android/APNs 설정 포함)
    FCM-->>PS: 전송 결과/에러
  end
Loading
sequenceDiagram
  autonumber
  participant API as API Layer
  participant PS as PillService
  participant PIR as PillIntakeRecordRepository
  API->>PS: deletePill(pillId)
  PS->>PIR: deleteByPill(pill)
  PS-->>API: 삭제 완료
Loading
sequenceDiagram
  autonumber
  participant App as Flutter App
  participant FLN as flutter_local_notifications
  participant FCMc as Firebase Messaging (Client)
  App->>FLN: initialize(iOS: categories/action)
  App->>FCMc: setForegroundNotificationPresentationOptions(alert,badge,sound)
  FCMc-->>App: 알림 수신(전경/배경)
  App-->>FLN: iOS 카테고리 액션 처리(ACCEPT)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

토끼는 귀 쫑긋, 똑딱 매 분마다
알약 알림 띵- 하고 밤하늘에 날아가
푸시 타고 폰에 톡, 로컬도 반짝반짝
먹었니? 눌러봐! ACCEPT로 깔끔하게
기록은 싹— 삭제는 착— 오늘도 안심 🥕✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Free

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ae35ff7 and f7ff39d.

📒 Files selected for processing (4)
  • backend/ongi/src/main/java/ongi/pill/repository/PillIntakeRecordRepository.java (1 hunks)
  • backend/ongi/src/main/java/ongi/pill/service/PillService.java (7 hunks)
  • frontend/ongi/lib/main.dart (3 hunks)
  • frontend/ongi/pubspec.yaml (1 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 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? Join our Discord community 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.

@Neibce Neibce merged commit 7dea95b into main Aug 21, 2025
4 checks passed
@Neibce Neibce deleted the fe/feat/fcm-custom-action branch August 21, 2025 20:29
Neibce added a commit to 2025-PNU-SW-Hackathon/PNUSW-2025-OnGi-10 that referenced this pull request Aug 25, 2025
* feat: 약 복용 알림 기능 추가

* feat: fcm 알림 약 복용 체크용 커스텀 액션 추가
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