-
Notifications
You must be signed in to change notification settings - Fork 1
[TWI-130] 초대 코드 공유 및 딥링크 진입 처리 #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chanho0908
wants to merge
15
commits into
develop
Choose a base branch
from
feat/#130-invitation
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
191de01
✨ Feat: core:share 모듈 추가 및 InviteLaunchDispatcher 구현
chanho0908 b87350a
✨ Feat: 초대 링크 공유하기 기능 구현
chanho0908 6ebe992
✨ Feat: InviteRoute 초대 코드 파라미터 지원
chanho0908 e5ddfd8
🐛 Fix: 온보딩 미완료 상태에서 앱 재진입 시 메인으로 이동하는 버그 수정
chanho0908 4d6fe35
✨ Feat: 초대 딥링크 진입 시 온보딩 상태별 라우팅 구현
chanho0908 89dee0a
✨ Feat: App Links 및 Firebase Hosting 설정
chanho0908 a257a9b
♻️ Refactor: LoginScreen 세로 스크롤 적용
chanho0908 005ced1
💄 Style: 코드 포맷팅
chanho0908 01eb94f
♻️ Refactor: 초대 공유 메시지 문구 수정
chanho0908 60b79f8
💄 Style: 초대 공유 메시지 줄바꿈 및 포맷 수정
chanho0908 bb04391
♻️ Refactor: SplashNavGraph 온보딩 이동 시 단일 네비게이션 호출로 개선
chanho0908 88d4055
🐛 Fix: 자신의 초대 코드 입력 시 에러 처리 추가
chanho0908 b3433d6
🐛 Fix: InviteRoute 진입 상태에서 딥링크 수신 시 초대 코드 미입력 버그 수정
chanho0908 5f52142
♻️ Refactor: 초대 메시지 내 오타 수정
chanho0908 12e3dd0
Merge branch 'develop' into feat/#130-invitation
chanho0908 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "projects": { | ||
| "default": "keepiluv" | ||
| } | ||
| } |
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
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
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
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
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
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
22 changes: 22 additions & 0 deletions
22
...navigation-contract/src/main/java/com/twix/navigation_contract/InviteLaunchEventSource.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.twix.navigation_contract | ||
|
|
||
| import android.content.Intent | ||
| import kotlinx.coroutines.flow.StateFlow | ||
|
|
||
| interface InviteLaunchEventSource { | ||
| val pendingInviteCode: StateFlow<String?> | ||
|
|
||
| fun dispatchFromIntent(intent: Intent?) | ||
|
|
||
| fun consumePendingInviteCode() | ||
|
|
||
| companion object { | ||
| const val INVITE_SCHEME = "twix" | ||
| const val INVITE_HOST = "invite" | ||
| const val INVITE_CODE_PARAM = "code" | ||
| const val PLAY_STORE_URL = "https://play.google.com/store/apps/details?id=com.yapp.twix" | ||
| const val INVITE_WEB_HOST = "keepiluv.web.app" | ||
|
|
||
| fun buildInviteDeepLink(inviteCode: String) = "https://$INVITE_WEB_HOST?$INVITE_CODE_PARAM=$inviteCode" | ||
| } | ||
| } | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| plugins { | ||
| alias(libs.plugins.twix.android.library) | ||
| alias(libs.plugins.twix.koin) | ||
| } | ||
|
|
||
| android { | ||
| namespace = "com.twix.share" | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(projects.core.navigationContract) | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
|
||
| </manifest> |
42 changes: 42 additions & 0 deletions
42
core/share/src/main/java/com/twix/share/InviteLaunchDispatcher.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package com.twix.share | ||
|
|
||
| import android.content.Intent | ||
| import android.net.Uri | ||
| import com.twix.navigation_contract.InviteLaunchEventSource | ||
| import kotlinx.coroutines.flow.MutableStateFlow | ||
| import kotlinx.coroutines.flow.StateFlow | ||
| import kotlinx.coroutines.flow.asStateFlow | ||
|
|
||
| class InviteLaunchDispatcher : InviteLaunchEventSource { | ||
| private val _pendingInviteCode = MutableStateFlow<String?>(null) | ||
| override val pendingInviteCode: StateFlow<String?> = _pendingInviteCode.asStateFlow() | ||
|
|
||
| override fun dispatchFromIntent(intent: Intent?) { | ||
| if (intent?.action != Intent.ACTION_VIEW) return | ||
| val uri = intent.data ?: return | ||
|
|
||
| if (!checkCustomScheme(uri) && !checkAppLink(uri)) return | ||
|
|
||
| val inviteCode = | ||
| uri | ||
| .getQueryParameter(InviteLaunchEventSource.INVITE_CODE_PARAM) | ||
| ?.takeIf { it.isNotBlank() } ?: return | ||
| _pendingInviteCode.value = inviteCode | ||
| } | ||
|
|
||
| private fun checkCustomScheme(uri: Uri) = | ||
| uri.scheme == InviteLaunchEventSource.INVITE_SCHEME && uri.host == InviteLaunchEventSource.INVITE_HOST | ||
|
|
||
| private fun checkAppLink(uri: Uri) = | ||
| (uri.scheme == HTTP_SCHEME || uri.scheme == HTTPS_SCHEME) && | ||
| uri.host == InviteLaunchEventSource.INVITE_WEB_HOST | ||
|
|
||
| override fun consumePendingInviteCode() { | ||
| _pendingInviteCode.value = null | ||
| } | ||
|
|
||
| companion object { | ||
| private const val HTTP_SCHEME = "http" | ||
| private const val HTTPS_SCHEME = "https" | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package com.twix.share.di | ||
|
|
||
| import com.twix.navigation_contract.InviteLaunchEventSource | ||
| import com.twix.share.InviteLaunchDispatcher | ||
| import org.koin.dsl.module | ||
|
|
||
| val shareModule = | ||
| module { | ||
| single<InviteLaunchEventSource> { InviteLaunchDispatcher() } | ||
| } |
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.