라이브, 콘텐츠, 채널 공유하기

- sns 공유시 보여줄 og data 제거
- shorturl이 적용되지 않은 상태에서 url이 너무 길기 떄문데 임시 적용
This commit is contained in:
klaus 2025-03-07 14:42:36 +09:00
parent 7885200af4
commit 6065b353fd
7 changed files with 8 additions and 29 deletions

View File

@ -777,16 +777,12 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
binding.tvShare.visibility = View.VISIBLE
binding.tvShare.setOnClickListener {
viewModel.shareContent(
audioContentId = audioContentId,
contentImage = response.coverImageUrl,
contentTitle = "${response.title} - ${response.creator.nickname}"
) {
viewModel.shareContent(audioContentId = audioContentId) {
val intent = Intent(Intent.ACTION_SEND)
intent.type = "text/plain"
intent.putExtra(Intent.EXTRA_TEXT, it)
val shareIntent = Intent.createChooser(intent, "오디오콘텐츠 공유")
val shareIntent = Intent.createChooser(intent, "오디오 콘텐츠 공유")
startActivity(shareIntent)
}
}

View File

@ -299,17 +299,12 @@ class AudioContentDetailViewModel(
fun shareContent(
audioContentId: Long,
contentImage: String,
contentTitle: String,
onSuccess: (String) -> Unit
) {
val params = mapOf(
"af_dp" to "voiceon://",
"deep_link_value" to "content",
"deep_link_sub5" to "$audioContentId",
"af_og_title" to contentTitle,
"af_og_description" to "지금 보이스온에서 이 콘텐츠 감상하기",
"af_og_image" to contentImage
"deep_link_sub5" to "$audioContentId"
)
val shareUrl = Utils.createOneLinkUrl(params = params)

View File

@ -648,8 +648,7 @@ class UserProfileActivity : BaseActivity<ActivityUserProfileBinding>(
layoutUserProfile.ivShare.setOnClickListener {
viewModel.shareChannel(
userId = creator.creatorId,
nickname = creator.nickname,
profileImage = creator.profileUrl
nickname = creator.nickname
) {
val intent = Intent(Intent.ACTION_SEND)
intent.type = "text/plain"

View File

@ -268,16 +268,12 @@ class UserProfileViewModel(
fun shareChannel(
userId: Long,
nickname: String,
profileImage: String,
onSuccess: (String) -> Unit
) {
val params = mapOf(
"af_dp" to "voiceon://",
"deep_link_value" to "channel",
"deep_link_sub5" to "$userId",
"af_og_title" to "보이스온",
"af_og_description" to "보이스온 ${nickname}님의 채널입니다.",
"af_og_image" to profileImage
"deep_link_sub5" to "$userId"
)
val shareUrl = Utils.createOneLinkUrl(params = params)
onSuccess("보이스온 ${nickname}님의 채널입니다.\n$shareUrl")

View File

@ -1005,8 +1005,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
viewModel.shareRoomLink(
response.roomId,
response.isPrivateRoom,
response.password,
response.coverImageUrl
response.password
) {
val intent = Intent(Intent.ACTION_SEND)
intent.type = "text/plain"

View File

@ -300,16 +300,12 @@ class LiveRoomViewModel(
roomId: Long,
isPrivateRoom: Boolean,
password: String?,
coverImage: String,
onSuccess: (String) -> Unit
) {
val params = mapOf(
"af_dp" to "voiceon://",
"deep_link_value" to "live",
"deep_link_sub5" to "$roomId",
"af_og_title" to "보이스온",
"af_og_description" to "지금 보이스온에서 라이브 참여하기",
"af_og_image" to coverImage
"deep_link_sub5" to "$roomId"
)
val shareUrl = Utils.createOneLinkUrl(params = params)

View File

@ -67,9 +67,7 @@ class LiveRoomDetailViewModel(private val repository: LiveRepository) : BaseView
val params = mapOf(
"af_dp" to "voiceon://",
"deep_link_value" to "live",
"deep_link_sub5" to "$roomId",
"af_og_title" to "보이스온",
"af_og_description" to "지금 보이스온에서 라이브 참여하기"
"deep_link_sub5" to "$roomId"
)
val shareUrl = Utils.createOneLinkUrl(params = params)