feat: 강의계획서를 외부 브라우저에서 인앱 바텀시트 WebView로 전환#630
Merged
Conversation
강의평과 동일한 바텀시트 WebView 패턴으로 강의계획서를 띄운다. - sugang 서버 Referer 검증을 통과하도록 WebView 로드에 Referer 헤더 주입 - 페이지 내 PDF 등 첨부 파일은 WebView 세션(Referer/쿠키/UA)째 DownloadManager로 다운로드 - 앱 전용 캐시에 저장(권한 불필요, 시스템 자동 정리) 후 뷰어 앱으로 열기
강의계획서를 여는 5개 진입점(시간표/딥링크 2종/북마크/검색)을 모두 외부 브라우저(ACTION_VIEW) 대신 인앱 바텀시트 WebView로 연결한다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
배경
강의계획서를 지금까지 외부 브라우저(
ACTION_VIEWIntent)로 열었는데, 이를 iOS와 동일하게 인앱 바텀시트 WebView로 전환합니다. iOS는noProxyUrl을 Referer 헤더와 함께 WebView로 띄우고 있어, 링크·로딩 방식을 iOS에 맞췄습니다.변경 사항
1. 여는 링크를 iOS와 동일하게 (
url→noProxyUrl)/v1/course_books/official응답에서 iOS가 쓰는noProxyUrl필드를 사용합니다.2. 인앱 바텀시트 WebView (강의평과 동일 패턴)
sugang.snu.ac.kr는 Referer를 검증하므로, iOS와 동일하게 WebView 로드에Referer헤더를 주입합니다. (외부 브라우저/Custom Tab으로는 Referer를 실을 수 없어 인앱 WebView가 유일한 방법)3. PDF 다운로드 (권한 0개)
DownloadManager로 다운로드합니다.tmp와 동일 성격) → 완료 시 뷰어 앱 자동 실행.아키텍처 결정
WebView 다운로드는 "우리 서버에서 도메인 데이터를 받는 것"이 아니라 **"WebView 브라우징 세션의 연속"**입니다. 쿠키·Referer·UA는 전부 WebView가 만든 세션의 산물이므로, sugang과 접촉하는 특수 코드(Referer 상수, 세션 헤더, 다운로드)를 WebView 컨테이너 안에 격리했습니다.
noProxyUrl획득(SNUTT API 호출)만 Repository(data)에 남김SyllabusWebViewContainer(View)에서 완결커밋 구성
noProxyUrl로 변경실기기 검증 필요