fix(chat): 채팅 쿼터 구매 동선을 정리한다
This commit is contained in:
@@ -8924,7 +8924,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = SodaLive/SodaLive.entitlements;
|
CODE_SIGN_ENTITLEMENTS = SodaLive/SodaLive.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 2;
|
CURRENT_PROJECT_VERSION = 3;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"SodaLive/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"SodaLive/Preview Content\"";
|
||||||
DEVELOPMENT_TEAM = 3A8QGPMRXM;
|
DEVELOPMENT_TEAM = 3A8QGPMRXM;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
@@ -8965,7 +8965,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = SodaLive/SodaLive.entitlements;
|
CODE_SIGN_ENTITLEMENTS = SodaLive/SodaLive.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 2;
|
CURRENT_PROJECT_VERSION = 3;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"SodaLive/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"SodaLive/Preview Content\"";
|
||||||
DEVELOPMENT_TEAM = 3A8QGPMRXM;
|
DEVELOPMENT_TEAM = 3A8QGPMRXM;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
|
|||||||
@@ -149,9 +149,6 @@ struct ChatRoomView: View {
|
|||||||
|
|
||||||
if viewModel.showQuotaNoticeView {
|
if viewModel.showQuotaNoticeView {
|
||||||
ChatQuotaNoticeItemView(
|
ChatQuotaNoticeItemView(
|
||||||
onSelectAd: {
|
|
||||||
viewModel.showRewardedAdForChatQuota()
|
|
||||||
},
|
|
||||||
onSelectCan10: {
|
onSelectCan10: {
|
||||||
viewModel.purchaseChatQuota(canOption: .can10)
|
viewModel.purchaseChatQuota(canOption: .can10)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -279,9 +279,16 @@ final class ChatRoomViewModel: ObservableObject {
|
|||||||
|
|
||||||
func showRewardedAdForChatQuota() {
|
func showRewardedAdForChatQuota() {
|
||||||
_Concurrency.Task {
|
_Concurrency.Task {
|
||||||
await YandexRewardedAdManager.shared.showAdIfAvailable(for: .chatRoomQuota) { [weak self] in
|
let isShown = await YandexRewardedAdManager.shared.showAdIfAvailable(for: .chatRoomQuota) { [weak self] in
|
||||||
self?.purchaseChatQuota(chargeType: .ad, canOption: nil)
|
self?.purchaseChatQuota(chargeType: .ad, canOption: nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !isShown {
|
||||||
|
await MainActor.run {
|
||||||
|
errorMessage = I18n.Chat.Room.rewardedAdLoadFailed
|
||||||
|
isShowPopup = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,31 +9,11 @@ import SwiftUI
|
|||||||
|
|
||||||
struct ChatQuotaNoticeItemView: View {
|
struct ChatQuotaNoticeItemView: View {
|
||||||
|
|
||||||
let onSelectAd: () -> Void
|
|
||||||
let onSelectCan10: () -> Void
|
let onSelectCan10: () -> Void
|
||||||
let onSelectCan20: () -> Void
|
let onSelectCan20: () -> Void
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(spacing: 10) {
|
VStack(spacing: 10) {
|
||||||
Button {
|
|
||||||
onSelectAd()
|
|
||||||
} label: {
|
|
||||||
Text(I18n.Chat.Room.quotaAdAction(chatCount: 5))
|
|
||||||
.appFont(size: 18, weight: .bold)
|
|
||||||
.foregroundColor(Color(hex: "263238"))
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
.padding(.vertical, 14)
|
|
||||||
}
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
.background(Color(hex: "FEF8E3"))
|
|
||||||
.cornerRadius(30)
|
|
||||||
.overlay {
|
|
||||||
RoundedRectangle(cornerRadius: 30)
|
|
||||||
.stroke(lineWidth: 1)
|
|
||||||
.foregroundColor(Color(hex: "F7CB50"))
|
|
||||||
}
|
|
||||||
.buttonStyle(.plain)
|
|
||||||
|
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 8) {
|
||||||
Button {
|
Button {
|
||||||
onSelectCan10()
|
onSelectCan10()
|
||||||
@@ -80,7 +60,6 @@ struct ChatQuotaNoticeItemView: View {
|
|||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
ChatQuotaNoticeItemView(
|
ChatQuotaNoticeItemView(
|
||||||
onSelectAd: {},
|
|
||||||
onSelectCan10: {},
|
onSelectCan10: {},
|
||||||
onSelectCan20: {}
|
onSelectCan20: {}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -300,6 +300,14 @@ enum I18n {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static var rewardedAdLoadFailed: String {
|
||||||
|
pick(
|
||||||
|
ko: "광고를 불러오지 못했어요\n잠시 후 다시 시도해 주세요.",
|
||||||
|
en: "Could not load the ad.\nPlease try again later.",
|
||||||
|
ja: "広告を読み込めませんでした。\nしばらくしてからもう一度お試しください。"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
static var backgroundSelectionTitle: String {
|
static var backgroundSelectionTitle: String {
|
||||||
pick(ko: "배경 이미지 선택", en: "Select background image", ja: "背景画像を選択")
|
pick(ko: "배경 이미지 선택", en: "Select background image", ja: "背景画像を選択")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user