공유링크 수정
This commit is contained in:
parent
ca30e6949f
commit
9adadaf572
|
@ -50,6 +50,17 @@
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
<intent-filter android:autoVerify="true">
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
|
||||||
|
<data android:scheme="http" />
|
||||||
|
<data android:scheme="https" />
|
||||||
|
<data android:host="sodalive.page.link" />
|
||||||
|
<data android:host="sodalive.net" />
|
||||||
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name=".main.MainActivity" />
|
<activity android:name=".main.MainActivity" />
|
||||||
<activity android:name=".user.login.LoginActivity" />
|
<activity android:name=".user.login.LoginActivity" />
|
||||||
|
|
|
@ -332,11 +332,11 @@ class AudioContentDetailViewModel(
|
||||||
) {
|
) {
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
Firebase.dynamicLinks.shortLinkAsync(ShortDynamicLink.Suffix.SHORT) {
|
Firebase.dynamicLinks.shortLinkAsync(ShortDynamicLink.Suffix.SHORT) {
|
||||||
link = Uri.parse("https://yozm.day/?audio_content_id=$audioContentId")
|
link = Uri.parse("https://sodalive.day/?audio_content_id=$audioContentId")
|
||||||
domainUriPrefix = "https://yozm.page.link"
|
domainUriPrefix = "https://sodalive.page.link"
|
||||||
androidParameters { }
|
androidParameters { }
|
||||||
iosParameters("kr.co.vividnext.yozm") {
|
iosParameters("kr.co.vividnext.sodalive") {
|
||||||
appStoreId = "1630284226"
|
appStoreId = "6461721697"
|
||||||
}
|
}
|
||||||
socialMetaTagParameters {
|
socialMetaTagParameters {
|
||||||
title = contentTitle
|
title = contentTitle
|
||||||
|
|
|
@ -295,11 +295,11 @@ class UserProfileViewModel(
|
||||||
fun shareChannel(userId: Long, onSuccess: (String) -> Unit) {
|
fun shareChannel(userId: Long, onSuccess: (String) -> Unit) {
|
||||||
_isLoading.value = true
|
_isLoading.value = true
|
||||||
Firebase.dynamicLinks.shortLinkAsync(ShortDynamicLink.Suffix.SHORT) {
|
Firebase.dynamicLinks.shortLinkAsync(ShortDynamicLink.Suffix.SHORT) {
|
||||||
link = Uri.parse("https://yozm.day/?channel_id=$userId")
|
link = Uri.parse("https://sodalive.day/?channel_id=$userId")
|
||||||
domainUriPrefix = "https://yozm.page.link"
|
domainUriPrefix = "https://sodalive.page.link"
|
||||||
androidParameters { }
|
androidParameters { }
|
||||||
iosParameters("kr.co.vividnext.yozm") {
|
iosParameters("kr.co.vividnext.sodalive") {
|
||||||
appStoreId = "1630284226"
|
appStoreId = "6461721697"
|
||||||
}
|
}
|
||||||
}.addOnSuccessListener {
|
}.addOnSuccessListener {
|
||||||
val uri = it.shortLink
|
val uri = it.shortLink
|
||||||
|
|
|
@ -241,11 +241,11 @@ class LiveRoomViewModel(
|
||||||
) {
|
) {
|
||||||
_isLoading.value = true
|
_isLoading.value = true
|
||||||
Firebase.dynamicLinks.shortLinkAsync(ShortDynamicLink.Suffix.SHORT) {
|
Firebase.dynamicLinks.shortLinkAsync(ShortDynamicLink.Suffix.SHORT) {
|
||||||
link = Uri.parse("https://yozm.day/?room_id=$roomId")
|
link = Uri.parse("https://sodalive.net/?room_id=$roomId")
|
||||||
domainUriPrefix = "https://yozm.page.link"
|
domainUriPrefix = "https://sodalive.page.link"
|
||||||
androidParameters { }
|
androidParameters { }
|
||||||
iosParameters("kr.co.vividnext.yozm") {
|
iosParameters("kr.co.vividnext.sodalive") {
|
||||||
appStoreId = "1630284226"
|
appStoreId = "6461721697"
|
||||||
}
|
}
|
||||||
}.addOnSuccessListener {
|
}.addOnSuccessListener {
|
||||||
val uri = it.shortLink
|
val uri = it.shortLink
|
||||||
|
|
|
@ -175,6 +175,9 @@ class LiveRoomDetailFragment(
|
||||||
binding.tvTags.text = response.tags.joinToString(" ") { "#$it" }
|
binding.tvTags.text = response.tags.joinToString(" ") { "#$it" }
|
||||||
binding.tvContent.text = response.notice
|
binding.tvContent.text = response.notice
|
||||||
|
|
||||||
|
binding.ivShare.setOnClickListener { shareRoom(response) }
|
||||||
|
binding.ivShare2.setOnClickListener { shareRoom(response) }
|
||||||
|
|
||||||
if (response.channelName.isNullOrBlank()) {
|
if (response.channelName.isNullOrBlank()) {
|
||||||
binding.tvParticipateExpression.text = "예약자"
|
binding.tvParticipateExpression.text = "예약자"
|
||||||
when {
|
when {
|
||||||
|
@ -321,4 +324,19 @@ class LiveRoomDetailFragment(
|
||||||
binding.llProfiles.addView(itemView.root)
|
binding.llProfiles.addView(itemView.root)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun shareRoom(response: GetRoomDetailResponse) {
|
||||||
|
viewModel.shareRoomLink(
|
||||||
|
response.roomId,
|
||||||
|
response.isPrivateRoom,
|
||||||
|
response.password
|
||||||
|
) {
|
||||||
|
val intent = Intent(Intent.ACTION_SEND)
|
||||||
|
intent.type = "text/plain"
|
||||||
|
intent.putExtra(Intent.EXTRA_TEXT, it)
|
||||||
|
|
||||||
|
val shareIntent = Intent.createChooser(intent, "라이브 공유")
|
||||||
|
startActivity(shareIntent)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,4 +63,41 @@ class LiveRoomDetailViewModel(private val repository: LiveRepository) : BaseView
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun shareRoomLink(
|
||||||
|
roomId: Long,
|
||||||
|
isPrivateRoom: Boolean,
|
||||||
|
password: Int?,
|
||||||
|
onSuccess: (String) -> Unit
|
||||||
|
) {
|
||||||
|
_isLoading.value = true
|
||||||
|
Firebase.dynamicLinks.shortLinkAsync(ShortDynamicLink.Suffix.SHORT) {
|
||||||
|
link = Uri.parse("https://sodalive.net/?room_id=$roomId")
|
||||||
|
domainUriPrefix = "https://sodalive.page.link"
|
||||||
|
androidParameters { }
|
||||||
|
iosParameters("kr.co.vividnext.sodalive") {
|
||||||
|
appStoreId = "6461721697"
|
||||||
|
}
|
||||||
|
}.addOnSuccessListener {
|
||||||
|
val uri = it.shortLink
|
||||||
|
if (uri != null) {
|
||||||
|
val message = if (isPrivateRoom) {
|
||||||
|
"${SharedPreferenceManager.nickname}님이 귀하를 " +
|
||||||
|
"소다라이브의 비공개라이브에 초대하였습니다.\n" +
|
||||||
|
"※ 라이브 참여: $uri\n" +
|
||||||
|
"(입장 비밀번호 : $password)"
|
||||||
|
} else {
|
||||||
|
"${SharedPreferenceManager.nickname}님이 귀하를 " +
|
||||||
|
"소다라이브의 공개라이브에 초대하였습니다.\n" +
|
||||||
|
"※ 라이브 참여: $uri"
|
||||||
|
}
|
||||||
|
|
||||||
|
onSuccess(message)
|
||||||
|
}
|
||||||
|
}.addOnFailureListener {
|
||||||
|
_toastLiveData.postValue("공유링크를 생성하지 못했습니다.\n다시 시도해 주세요.")
|
||||||
|
}.addOnCompleteListener {
|
||||||
|
_isLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -331,11 +331,20 @@
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
tools:ignore="UseCompoundDrawables">
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_share2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/btn_big_share" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_modify"
|
android:id="@+id/tv_modify"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="13.3dp"
|
||||||
android:background="@drawable/bg_round_corner_10_transparent_9970ff"
|
android:background="@drawable/bg_round_corner_10_transparent_9970ff"
|
||||||
android:fontFamily="@font/gmarket_sans_bold"
|
android:fontFamily="@font/gmarket_sans_bold"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
@ -382,6 +391,15 @@
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_share"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:contentDescription="@null"
|
||||||
|
android:src="@drawable/btn_big_share"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_reservation_complete"
|
android:id="@+id/tv_reservation_complete"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue