iap button for aboutView
This commit is contained in:
1 parent
9c43e39ffb
commit
7d7b909c66
3 files changed
+58
-7
No files matched your search
@@ -90,6 +90,34 @@ public struct AboutView: View {
|
|||||||
Link(LocalizationHelper.localizedString(forKey: "joinCommunity"), destination: URL(string: LocalizationHelper.localizedString(forKey: "communityLink"))!)
|
Link(LocalizationHelper.localizedString(forKey: "joinCommunity"), destination: URL(string: LocalizationHelper.localizedString(forKey: "communityLink"))!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HStack(spacing: 15) {
|
||||||
|
if #available(iOS 15.0, *) {
|
||||||
|
if GenericUtils.isIPad() {
|
||||||
|
Button(LocalizationHelper.localizedString(forKey: "I'm an artist")) {
|
||||||
|
IAPManager.checkPurchaseInfo(.PencilProPack) { info in
|
||||||
|
if !info.valid {
|
||||||
|
IAPManager.inAppPurchaseAction(viewController: self.aboutVC, product: .PencilProPack)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
AlertControllerUtil.showAlert(
|
||||||
|
in: self.aboutVC,
|
||||||
|
title: "",
|
||||||
|
message: LocalizationHelper.localizedString(forKey:"Drawing Toolkit already purchased"),
|
||||||
|
withCancel: false,
|
||||||
|
buttonTitle: LocalizationHelper.localizedString(forKey: "OK"),
|
||||||
|
countdown: 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.padding()
|
||||||
|
.background(Color.blue.opacity(1))
|
||||||
|
.foregroundColor(.white)
|
||||||
|
.frame(height: 46)
|
||||||
|
.cornerRadius(12)
|
||||||
|
.padding(.top, 10)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// OK 按钮
|
// OK 按钮
|
||||||
Button(LocalizationHelper.localizedString(forKey: "OK")) {
|
Button(LocalizationHelper.localizedString(forKey: "OK")) {
|
||||||
aboutVC.dismiss(animated:true)
|
aboutVC.dismiss(animated:true)
|
||||||
@@ -100,6 +128,9 @@ public struct AboutView: View {
|
|||||||
.frame(height: 46)
|
.frame(height: 46)
|
||||||
.cornerRadius(12)
|
.cornerRadius(12)
|
||||||
.padding(.top, 10)
|
.padding(.top, 10)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
HStack(spacing: 20) {
|
HStack(spacing: 20) {
|
||||||
Button(LocalizationHelper.localizedString(forKey: "Join us")) {
|
Button(LocalizationHelper.localizedString(forKey: "Join us")) {
|
||||||
|
|||||||
@@ -6612,19 +6612,19 @@
|
|||||||
"zh-Hans" : {
|
"zh-Hans" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "translated",
|
"state" : "translated",
|
||||||
"value" : "绘画"
|
"value" : "绘画进阶套件"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zh-Hant" : {
|
"zh-Hant" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "translated",
|
"state" : "translated",
|
||||||
"value" : "繪畫"
|
"value" : "繪畫進階套件"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zh-HK" : {
|
"zh-HK" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "translated",
|
"state" : "translated",
|
||||||
"value" : "繪畫"
|
"value" : "繪畫進階套件"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6721,7 +6721,7 @@
|
|||||||
},
|
},
|
||||||
"zh-HK" : {
|
"zh-HK" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "needs_review",
|
"state" : "translated",
|
||||||
"value" : "一塊啥都不幹的擋板區域"
|
"value" : "一塊啥都不幹的擋板區域"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9085,6 +9085,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"I'm an artist" : {
|
||||||
|
"extractionState" : "manual",
|
||||||
|
"localizations" : {
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "我是画手"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hant" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "我是畫手"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-HK" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "我是畫手"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Import" : {
|
"Import" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|||||||
@@ -368,9 +368,6 @@ import StoreKit
|
|||||||
|
|
||||||
@objc static public func inAppPurchaseAction(viewController: UIViewController, product: AddOnProduct){
|
@objc static public func inAppPurchaseAction(viewController: UIViewController, product: AddOnProduct){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let alert = UIAlertController(title: product.productName(),
|
let alert = UIAlertController(title: product.productName(),
|
||||||
message: LocalizationHelper.localizedString(forKey: "No purchase found", product.productName()),
|
message: LocalizationHelper.localizedString(forKey: "No purchase found", product.productName()),
|
||||||
preferredStyle: .alert)
|
preferredStyle: .alert)
|
||||||
|
|||||||
Reference in new issue
Block a user