Skip to content

[Fix] APNs silent push 설정을 추가#136

Merged
pooreumjung merged 2 commits into
developfrom
fix/#135-tracking-fcm-ios-background
May 27, 2026
Merged

[Fix] APNs silent push 설정을 추가#136
pooreumjung merged 2 commits into
developfrom
fix/#135-tracking-fcm-ios-background

Conversation

@pooreumjung

Copy link
Copy Markdown
Member

🧾 요약

  • iOS 백그라운드 상태에서도 트래킹 data-only FCM 알림이 처리될 수 있도록 APNs silent push 설정을 추가했습니다.

🔗 이슈

✨ 변경 내용

  • dataOnly=true FCM 메시지에 APNs contentAvailable=true 설정 추가
  • 일반 notification payload 알림은 기존 동작 유지
  • dataOnly 조건을 명시적으로 분리해 APNs 설정 적용 의도 개선

✅ 확인

  • 빌드 OK
    • ./gradlew compileJava
  • 테스트 OK
    • ./gradlew test --tests
      com.semosan.api.domain.notification.dispatcher.AsyncNotificationDispatcherTest

@pooreumjung pooreumjung self-assigned this May 27, 2026
@pooreumjung pooreumjung added the bug Something isn't working label May 27, 2026
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 92bdc25a-ea2a-40d5-a845-a45b5abb0980

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/#135-tracking-fcm-ios-background

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

iOS 환경에서 data-only FCM 메시지가 백그라운드 상태에서도 정상적으로 처리될 수 있도록 APNs 설정을 최적화했습니다. 기존의 알림 로직은 유지하면서, dataOnly 조건에 따라 silent push를 명시적으로 설정하도록 변경하여 안정성을 높였습니다.

Highlights

  • APNs silent push 설정 추가: dataOnly가 true인 FCM 메시지에 대해 APNs contentAvailable=true 설정을 적용하여 iOS 백그라운드 환경에서의 알림 처리를 개선했습니다.
  • 로직 분리 및 명시화: 일반 알림과 data-only 알림의 설정을 명시적으로 분리하여 코드의 의도를 명확히 했습니다.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@pooreumjung
pooreumjung merged commit eb662a7 into develop May 27, 2026
3 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

이번 풀이 리퀘스트는 FCM 서비스(FcmService)에서 데이터 전용(silent push) 메시지 전송을 지원하기 위해 APNs 설정을 추가하는 변경 사항을 포함하고 있습니다. 리뷰어는 silentPushApnsConfig() 메서드가 호출될 때마다 매번 새로운 ApnsConfig 객체를 생성하는 대신, 불변 객체이므로 private static final 상수로 선언하여 재사용하도록 리팩토링할 것을 제안했습니다. 이는 불필요한 객체 생성을 방지하고 성능 및 가독성을 향상시키는 유용한 피드백입니다.

Comment on lines +49 to +55
private ApnsConfig silentPushApnsConfig() {
return ApnsConfig.builder()
.setAps(Aps.builder()
.setContentAvailable(true)
.build())
.build();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

silentPushApnsConfig() 메서드는 호출될 때마다 새로운 ApnsConfig 객체를 생성합니다. 이 설정 객체는 불변(immutable)이며 내용이 항상 동일하므로, private static final 상수로 선언하여 재사용하는 것이 더 효율적입니다.

다음과 같이 클래스 수준의 상수로 변경하고 sendMessage 메서드에서 직접 참조하도록 리팩토링하는 것을 권장합니다. 이렇게 하면 불필요한 객체 생성을 방지하고 코드의 가독성을 높일 수 있습니다.

// FcmService 클래스에 추가
private static final ApnsConfig SILENT_PUSH_APNS_CONFIG = ApnsConfig.builder()
        .setAps(Aps.builder().setContentAvailable(true).build())
        .build();

// sendMessage 메서드 내에서 변경
if (dataOnly) {
    builder.setApnsConfig(SILENT_PUSH_APNS_CONFIG);
}

// silentPushApnsConfig() 메서드는 제거됩니다.

@howooyeon
howooyeon deleted the fix/#135-tracking-fcm-ios-background branch May 29, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] APNs silent push 설정 추가

1 participant