Skip to content

fix: Android 카메라 호출 후 앱 kill 시 WebView URL 복원#2

Merged
hyejj19 merged 2 commits intomainfrom
android-camera-crash-fix
Jan 27, 2026
Merged

fix: Android 카메라 호출 후 앱 kill 시 WebView URL 복원#2
hyejj19 merged 2 commits intomainfrom
android-camera-crash-fix

Conversation

@hyejj19
Copy link
Copy Markdown
Collaborator

@hyejj19 hyejj19 commented Jan 19, 2026

변경 사항

  • SharedPreferences를 이용한 URL 저장/복원 기능 추가
  • 카메라 호출 전 현재 URL을 저장하고, 앱 재시작 시 복원
  • 5분 유효 시간으로 오래된 URL 복원 방지
  • Android 전용 기능 (iOS는 이 문제가 없음)

테스트

  • 로컬 테스트 완료
  • iOS 빌드/실행 확인
  • Android 빌드/실행 확인

스크린샷 (UI 변경 시)

N/A

관련 이슈

카메라 호출 전 현재 URL을 SharedPreferences에 저장하고,
앱이 메모리 부족으로 kill되었다 재시작될 때 저장된 URL로 복원합니다.
iOS는 이 문제가 없어 Android 전용 기능입니다.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 19, 2026 18:13
@hyejj19 hyejj19 self-assigned this Jan 19, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Android에서 카메라 호출 시 메모리 부족으로 앱이 kill되면 WebView URL이 초기화되는 문제를 SharedPreferences를 이용해 해결하는 PR입니다.

주요 변경사항:

  • UrlRestoreManager를 통한 URL 저장/복원 로직 추가 (5분 유효 시간)
  • 카메라 호출 전 현재 URL 저장, 앱 재시작 시 복원
  • Android 전용 기능으로 Platform 분기 처리

우려되는 점:

  • URL 삭제 후 유효 시간 체크로 인한 로직 오류
  • 카메라 취소 시 URL 미삭제로 인한 잘못된 복원 가능성
  • 스플래시 화면 초기화 에러 시 앱이 멈출 수 있는 시나리오

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/utils/url_restore_manager.dart URL 저장/복원 매니저 신규 추가 (Android 전용, 5분 유효 시간)
lib/main.dart 앱 시작 시 복원 URL 확인 및 WebView 초기화 로직 수정
lib/web_view/web_view.dart initialUrl 파라미터 추가하여 복원 URL 지원
lib/bridge/web_view_bridge_handler.dart 카메라 호출 전 URL 저장 및 완료/에러 시 정리 로직 추가
pubspec.yaml shared_preferences 의존성 추가
pubspec.lock shared_preferences를 direct main dependency로 변경

- consumeRestoredUrl()에서 유효 시간 체크 순서 수정
- SplashScreen 초기화 시 try-catch 에러 처리 추가

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@hyejj19 hyejj19 merged commit 66c6be1 into main Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants