Skip to content
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

fix : 동적 링크, 일반 링크로 변경 #291

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,10 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.google.firebase.Firebase
import com.google.firebase.dynamiclinks.androidParameters
import com.google.firebase.dynamiclinks.dynamicLinks
import com.google.firebase.dynamiclinks.iosParameters
import com.google.firebase.dynamiclinks.shortLinkAsync
import com.nexters.boolti.domain.model.ShowDetail
import com.nexters.boolti.domain.model.ShowState
import com.nexters.boolti.presentation.R
import com.nexters.boolti.presentation.component.BtAppBar
import com.nexters.boolti.presentation.component.BtAppBarDefaults
import com.nexters.boolti.presentation.component.MainButton
import com.nexters.boolti.presentation.component.MainButtonDefaults
import com.nexters.boolti.presentation.component.ShowInquiry
import com.nexters.boolti.presentation.component.SmallButton
import com.nexters.boolti.presentation.extension.requireActivity
Expand Down Expand Up @@ -250,34 +242,17 @@ private fun ShowDetailAppBar(
iconRes = R.drawable.ic_share,
description = stringResource(id = R.string.ticketing_share),
onClick = {
Firebase.dynamicLinks.shortLinkAsync {
val uri = Uri.parse("https://preview.boolti.in/show/$showId")
link = uri
domainUriPrefix = "https://boolti.page.link"

androidParameters {
fallbackUrl = uri
}
iosParameters("com.nexters.boolti") {
setFallbackUrl(uri)
}
}.addOnSuccessListener {
it.shortLink?.let { link ->
println(link)

val sendIntent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(
Intent.EXTRA_TEXT,
link.toString()
)
type = "text/plain"
}

val shareIntent = Intent.createChooser(sendIntent, null)
context.startActivity(shareIntent)
}
val sendIntent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(
Intent.EXTRA_TEXT,
"https://preview.boolti.in/show/$showId"
)
type = "text/plain"
}
val shareIntent = Intent.createChooser(sendIntent, null)

context.startActivity(shareIntent)
},
)
BtAppBarDefaults.AppBarIconButton(
Expand Down
Loading