-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 문의하기 클릭 시 kakao channel로 연결 코드 SDK 코드로 수정 #448
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,10 +26,13 @@ import com.eatssu.android.presentation.mypage.myreview.MyReviewListComposeActivi | |
| import com.eatssu.android.presentation.mypage.terms.WebViewActivity | ||
| import com.eatssu.android.presentation.mypage.userinfo.UserInfoActivity | ||
| import com.eatssu.android.presentation.util.showToast | ||
| import com.eatssu.common.EventLogger | ||
| import com.eatssu.common.UiEvent | ||
| import com.eatssu.common.UiState | ||
| import com.eatssu.common.enums.ScreenId | ||
| import com.google.android.gms.oss.licenses.OssLicensesMenuActivity | ||
| import com.kakao.sdk.common.util.KakaoCustomTabsClient | ||
| import com.kakao.sdk.talk.TalkApiClient | ||
| import dagger.hilt.android.AndroidEntryPoint | ||
| import kotlinx.coroutines.flow.collectLatest | ||
| import kotlinx.coroutines.launch | ||
|
|
@@ -138,11 +141,15 @@ class MyPageFragment : BaseFragment<FragmentMyPageBinding>(ScreenId.MYPAGE_MAIN) | |
| } | ||
|
|
||
| binding.llInquire.setOnClickListener { | ||
| startWebView( | ||
| getString(R.string.kakao_talk_channel_url), | ||
| getString(R.string.contact), | ||
| ScreenId.EXTERNAL_INQUIRE | ||
| ) | ||
| val context = requireContext() | ||
| val channelPublicId = "_ZlVAn" | ||
|
|
||
| TalkApiClient.instance.chatChannel(context, channelPublicId) { | ||
| val url = TalkApiClient.instance.chatChannelUrl(channelPublicId) | ||
| KakaoCustomTabsClient.openWithDefault(context, url) | ||
| } | ||
|
Comment on lines
+147
to
+150
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
TalkApiClient.instance.chatChannel(context, channelPublicId) { error ->
if (error != null) {
Timber.d(error, "카카오톡 채널 채팅 열기 실패")
val url = TalkApiClient.instance.chatChannelUrl(channelPublicId)
KakaoCustomTabsClient.openWithDefault(context, url)
}
} |
||
|
|
||
| EventLogger.screenView(ScreenId.EXTERNAL_INQUIRE) | ||
| } | ||
|
|
||
| binding.llMyReview.setOnClickListener { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
채널 ID가 하드코딩되어 있습니다. 코드의 가독성과 유지보수성을 높이기 위해
companion object에 상수로 정의하는 것을 권장합니다. 예를 들어,MyPageFragment클래스 내에companion object { private const val KAKAO_TALK_CHANNEL_PUBLIC_ID = "_ZlVAn" }를 추가하고, 이 상수를 사용해주세요.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
상수화하면 조을것 같아용