[FEATURE] 공유하기로 전달된 링크 자동 입력#39
Merged
Merged
Conversation
sunm2n
approved these changes
May 17, 2026
Contributor
sunm2n
left a comment
There was a problem hiding this comment.
수고하셨습니다
리뷰 단 내용도 필수 사항은 아니고 제안정도라서 반영하실지는 판단정도만 해주시면 될 거 같습니다.
당장 머지해도 큰 문제가 일어나지 않을 거 같고 다만 추후 배포 이후 실제 앱에서도 잘 동작하는지만 추가 확인을 하면 될 거 같습니다
|
|
||
| const sharedUrl = hasShareIntent ? getSharedUrlFromIntent(shareIntent) : null; | ||
|
|
||
| if (sharedUrl) { |
Contributor
There was a problem hiding this comment.
현재코드:
if (sharedUrl) {
router.replace({ pathname: '/(tabs)/(home)/add-link', params: { sharedUrl }
});
resetShareIntent(true);
} else {
if (hasShareIntent) {
resetShareIntent(true);
}
router.replace('/(tabs)/(home)');
}
제안:
if (hasShareIntent) resetShareIntent(true);
if (sharedUrl) {
router.replace({ pathname: '/(tabs)/(home)/add-link', params: { sharedUrl }
});
} else {
router.replace('/(tabs)/(home)');
}
동작은 동일하고, resetShareIntent를 한 곳에서만 처리해 의도가 더 명확지지 않을까 합니다.
큰 문제는 아니고 가독성 향상을 위한 제안이라 반영할지 넘길지 판단만 해주시면 될 거 같습니다.
Contributor
Author
There was a problem hiding this comment.
좋은 제안 감사합니다. 말씀해주신 대로 share intent가 있는 경우에는 URL 추출 성공 여부와 관계없이 소비한 intent를 정리하는 흐름이라, resetShareIntent(true)를 분기 밖에서 한 번만 처리하도록 반영했습니다.
이렇게 하니 중복도 줄고, 공유 인텐트를 처리한 뒤 정리한다는 의도가 더 명확해지는 것 같습니다.
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.
Closes #38
개요
외부 앱에서 URL을 공유했을 때 LinClean 앱이 실행되고, 로그인된 사용자라면
링크 추가화면으로 이동하도록 구현했습니다.기존에는 사용자가 앱 내부에서 직접
링크 추가화면에 진입한 뒤 URL을 복사/붙여넣기 해야 했지만, 이번 작업에서는 브라우저, 메신저 등 외부 앱의 공유하기 기능을 통해 전달된 링크를 LinClean에서 받아오고, 해당 링크를링크 추가입력창에 자동으로 입력되도록 개선했습니다.공유 진입 시에도 기존 인증 흐름은 유지됩니다. 로그인된 상태라면 회원 동기화가 완료된 뒤
링크 추가화면으로 이동하고, 비로그인 상태라면 기존 로그인 화면으로 진입합니다. 비로그인 상태에서 공유 진입 후 Google 로그인에 성공한 경우에도 공유받은 URL을 유지해링크 추가화면에 자동 반영되도록 처리했습니다.또한 앱이 이미 실행 중인 상태뿐 아니라 종료된 상태에서 공유하기로 앱을 실행하는 cold start 상황에서도 공유 URL을 놓치지 않도록
expo-share-intent초기화 순서와 라우팅 타이밍을 보완했습니다.주요 구현 내용
expo-share-intent기반 외부 앱 공유 URL 수신 설정text/*등록ShareIntentProvider설정ShareIntentRouter추가링크 추가화면으로 이동링크 추가화면 이동링크 추가입력창에 자동 입력expo-share-intent패치 추가xcode패치 추가파일별 역할
app.json:expo-share-intentplugin 및 Android 공유 인텐트 설정app/_layout.tsx:ShareIntentProvider추가app/(tabs)/_layout.tsx: 로그인 및 회원 동기화 완료 후ShareIntentRouter실행app/(auth)/login.tsx: 비로그인 공유 진입 후 로그인 성공 시 공유 URL 처리app/(tabs)/(home)/add-link.tsx:sharedUrl파라미터를 입력창에 자동 반영components/share-intent-router.tsx: 공유 URL 감지 및링크 추가화면 라우팅 처리utils/shared-url.ts: 공유 텍스트에서 HTTP URL 추출 및 정규화plugins/with-android-single-task.js: AndroidsingleTask및 cleartext 설정 보완package.json,package-lock.json:expo-share-intent,patch-package의존성 및 postinstall 설정patches/expo-share-intent+5.1.1.patch: cold start 공유 인텐트 수신 순서 보완patches/xcode+3.0.1.patch: iOS prebuild 시 xcode group path 접근 오류 방어해결한 이슈 목록
링크 추가화면으로 이동링크 추가화면에 반영되도록 처리체크 사항
참고
dev 모드에서는 앱이 꺼진 상태에서 공유하기로 진입했을 때 cold start 공유 흐름이 정상 확인되지 않았습니다.
이후 preview 빌드로 테스트한 결과, 앱이 종료된 상태에서 외부 앱 공유하기로 LinClean을 실행해도 공유 URL이
링크 추가입력창에 정상 반영되는 것을 확인했습니다.아래 동영상은 preview 빌드를 통해 실행한 동작 영상입니다.
Screenshots or Video
라인 앱 -> Linclean 앱
https://github.com/user-attachments/assets/240ac752-5cad-45bd-9cb9-1faf152fb73f