[feature] 구독 버튼 브라우저 분기 (앱/스토어) #1634
Conversation
- useOpenApp 훅 신규: 앱 설치 시 딥링크 진입, 미설치 시 스토어(Android intent fallback / iOS 스킴+타임아웃) - useWebviewSubscribe: 비인앱이면 openApp(), 인앱은 기존 구독 토글 유지 - appStoreLink 재사용, 카카오 전용 useOpenAppFromKakao와 분리
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 5 minutes and 54 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Warning
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new React hook, useOpenApp, which handles opening the mobile application via deep links or redirecting users to the appropriate app store if the app is not installed. It also integrates this hook into useWebviewSubscribe to prompt users in standard web browsers to open the app when attempting to toggle subscriptions. The reviewer provided valuable feedback on useOpenApp to prevent potential memory leaks by properly cleaning up the visibilitychange event listener on unmount, to wrap openApp in useCallback to maintain reference integrity, and to strip leading slashes from the path to avoid malformed triple-slash (///) iOS custom scheme URLs.
- visibilitychange 리스너를 ref로 추적해 언마운트/타임아웃 시 정리(메모리 누수 방지) - openApp을 useCallback으로 감싸 참조 안정성 확보 - iOS 커스텀 스킴 경로 선행 슬래시 제거로 '///' 중복 방지
요약
바텀 네비 웹뷰 이관(MOA-923)의 일부. 일반 브라우저(비인앱)에서 구독 버튼을 누르면 앱 설치 시 앱으로, 미설치 시 스토어로 유도한다. (구독=푸시는 앱 전용 기능이므로)
변경
useOpenApp훅 신규 —appStoreLink재사용intent://...;S.browser_fallback_url=<store>;end(OS가 설치여부 자동 분기)moadongapp://스킴 시도 → 2초 내 미실행 시 App StoreuseWebviewSubscribe.toggleSubscribe—isInAppWebView()분기: 비인앱이면openApp(), 인앱은 기존 브릿지 토글 유지useOpenAppFromKakao는 건드리지 않음(별 훅)