Skip to content

[Fix] iOS 알림·위치 설정 및 마이페이지 주소 연동 - #27

Open
sunnny619 wants to merge 4 commits into
mainfrom
fix/ios-alarm
Open

[Fix] iOS 알림·위치 설정 및 마이페이지 주소 연동#27
sunnny619 wants to merge 4 commits into
mainfrom
fix/ios-alarm

Conversation

@sunnny619

Copy link
Copy Markdown
Contributor

Issue

  • closes #

Description

  • iOS 포그라운드 알림 수신

    • AppDelegate에 UNUserNotificationCenterDelegate 명시적 설정 및 willPresent 구현으로 앱 실행 중에도 알림 표시
    • iOS 위치 권한 수정
      • permission_handler만으로는 geolocator의 CLLocationManager가 권한을 인식 못하는 iOS 이슈 수정
      • _initializeLocation() 진입 시 Geolocator.checkPermission() / requestPermission() 추가
    • 바텀 네비게이션 탭 전환 시 화면 재빌드
      • IndexedStack 제거 → _screens[currentIndex] 직접 렌더링으로 탭 전환 시마다 화면 dispose & rebuild
    • 마이페이지 주소 자동 표시
      • 서버 프로필에 주소가 없을 경우 위도·경도 역지오코딩으로 저장된 SecureStorage 주소를 fallback으로 표시

    Test plan

    • iOS 실기기에서 앱 포그라운드 상태 중 근접 알림 수신 확인
    • iOS 첫 실행 시 위치 권한 요청 팝업 → 허용 후 지도에 현재 위치 정상 표시 확인
    • 바텀 탭 전환 시 각 화면 재빌드(상태 초기화) 확인

Screenshot

💬 리뷰 요구사항(선택)

@sunnny619
sunnny619 requested a review from joojae02 March 20, 2026 16:27
@sunnny619 sunnny619 self-assigned this Mar 20, 2026
@sunnny619 sunnny619 added the fix label Mar 20, 2026
@gemini-code-assist

Copy link
Copy Markdown

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 환경에서의 사용자 경험을 개선하고 특정 기능의 안정성을 높이는 데 중점을 둡니다. iOS 알림 및 위치 권한 처리의 고질적인 문제를 해결하여 앱의 핵심 기능이 원활하게 작동하도록 보장하며, 사용자 인터페이스의 동작 방식을 조정하여 탭 전환 시 화면 상태가 일관되게 초기화되도록 합니다. 또한, 마이페이지에서 사용자 주소 정보가 더 견고하게 표시되도록 데이터 로딩 로직을 개선했습니다.

Highlights

  • iOS 포그라운드 알림 수신 개선: 앱 실행 중에도 알림이 표시되도록 AppDelegateUNUserNotificationCenterDelegate를 명시적으로 설정하고 willPresent 메서드를 구현했습니다.
  • iOS 위치 권한 처리 수정: geolocatorCLLocationManager 권한을 올바르게 인식하지 못하는 iOS 문제를 해결하기 위해 _initializeLocation() 진입 시 Geolocator.checkPermission()requestPermission() 호출을 추가했습니다.
  • 바텀 네비게이션 탭 전환 시 화면 재빌드: IndexedStack을 제거하고 _screens[currentIndex]를 직접 렌더링하여 탭 전환 시마다 화면이 dispose되고 재빌드되도록 변경했습니다.
  • 마이페이지 주소 자동 표시 로직 개선: 서버 프로필에 주소가 없을 경우, 위도·경도 역지오코딩으로 저장된 SecureStorage의 주소를 대체 값으로 표시하도록 구현했습니다.
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 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 counter productive. 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.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

이 PR은 iOS에서의 포그라운드 알림 수신, 위치 권한 처리, 그리고 마이페이지 주소 표시 로직을 개선하는 여러 수정 사항을 포함하고 있습니다. 전반적으로 코드 변경 사항은 명확하며 PR의 목적을 잘 달성하고 있습니다. 다만, iOS 네이티브 코드와 위치 권한 처리 로직에서 몇 가지 잠재적인 문제를 발견하여 수정을 제안합니다. 자세한 내용은 각 파일의 주석을 참고해주세요.

Comment on lines +66 to +73
if (permission == LocationPermission.deniedForever) {
debugPrint('[MapViewModel] 위치 권한 영구 거부');
currentLocation = const LatLng(37.5665, 126.9780);
isLoading = false;
notifyListeners();
_startLocationStream();
return;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

위치 권한이 영구적으로 거부된(LocationPermission.deniedForever) 상태에서 _startLocationStream()을 호출하면 Geolocator.getPositionStream에서 처리되지 않은 PermissionDeniedException이 발생하여 앱이 비정상적으로 종료될 수 있습니다. 권한이 없는 경우에는 위치 스트림을 시작하지 않도록 해당 호출을 제거하는 것을 제안합니다.

      if (permission == LocationPermission.deniedForever) {
        debugPrint('[MapViewModel] 위치 권한 영구 거부');
        currentLocation = const LatLng(37.5665, 126.9780);
        isLoading = false;
        notifyListeners();
        return;
      }

Comment on lines +38 to +44
override func userNotificationCenter(
_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
) {
completionHandler([.banner, .sound, .badge])
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

override 키워드는 슈퍼클래스의 메서드를 재정의할 때 사용합니다. userNotificationCenter 메서드는 UNUserNotificationCenterDelegate 프로토콜에 정의된 메서드이며, FlutterAppDelegate는 이 메서드를 기본적으로 구현하고 있지 않습니다. 따라서 override 키워드는 불필요하며, 릴리즈 빌드 시 컴파일 오류를 유발할 수 있습니다. override를 제거하는 것을 제안합니다.

또한, AppDelegateUNUserNotificationCenterDelegate 프로토콜을 준수하도록 클래스 선언부에 명시하는 것이 좋습니다. (예: class AppDelegate: FlutterAppDelegate, ..., UNUserNotificationCenterDelegate)

Suggested change
override func userNotificationCenter(
_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
) {
completionHandler([.banner, .sound, .badge])
}
func userNotificationCenter(
_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void
) {
completionHandler([.banner, .sound, .badge])
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant