优惠
This commit is contained in:
parent
842dc90aeb
commit
88962b4be7
@ -109,12 +109,15 @@ extension APInAppPurchseVC {
|
|||||||
// 请求商品列表
|
// 请求商品列表
|
||||||
func fetchIAPs() {
|
func fetchIAPs() {
|
||||||
// let oldIAPs = await ascAPI.fetchInAppPurchasesList(appId: currentApp!.appId)
|
// let oldIAPs = await ascAPI.fetchInAppPurchasesList(appId: currentApp!.appId)
|
||||||
|
// https://developer.apple.com/documentation/appstoreconnectapi/get-v2-inapppurchases-_id_
|
||||||
|
|
||||||
APClient.iaps(appid: currentApp!.appId)
|
APClient.iaps(appid: currentApp!.appId)
|
||||||
.request(showLoading: true, inView: self.view) { [weak self] result, response, error in
|
.request(showLoading: true, inView: self.view) { [weak self] result, response, error in
|
||||||
guard let err = error else {
|
guard let err = error else {
|
||||||
guard let app = self?.currentApp else { return } //请求过程关闭页面可能导致为空
|
guard let app = self?.currentApp else { return } //请求过程关闭页面可能导致为空
|
||||||
print(result.toJsonString() ?? "")
|
print(result.toJsonString() ?? "")
|
||||||
let iapL = IAPList(body:result, app: app)
|
let iapL = IAPList(body:result, app: app)
|
||||||
|
|
||||||
self?.iapList = iapL.iapList
|
self?.iapList = iapL.iapList
|
||||||
self?.outlineView.reloadData()
|
self?.outlineView.reloadData()
|
||||||
self?.updateRowInfo()
|
self?.updateRowInfo()
|
||||||
@ -125,6 +128,18 @@ extension APInAppPurchseVC {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateRowInfo() {
|
func updateRowInfo() {
|
||||||
|
|
||||||
|
// guard let ascKey = InfoCenter.shared.currentASCKey else { return }
|
||||||
|
//
|
||||||
|
// let ascAPI = APASCAPI.init(issuerID: ascKey.issuerID,
|
||||||
|
// privateKeyID: ascKey.privateKeyID,
|
||||||
|
// privateKey: ascKey.privateKey,
|
||||||
|
// showApiRateLimit: false)
|
||||||
|
// Task {
|
||||||
|
// let list = await ascAPI.fetchInAppPurchasesList(appId: currentApp!.appId)
|
||||||
|
// print(list)
|
||||||
|
// }
|
||||||
|
|
||||||
// TODO: 接口请求失败
|
// TODO: 接口请求失败
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@ -188,6 +188,8 @@ extension APUploadIAPListVC {
|
|||||||
ascAPI.addMessage("开始更新内购本地化版本:\(product.productId)")
|
ascAPI.addMessage("开始更新内购本地化版本:\(product.productId)")
|
||||||
let localizations = await ascAPI.fetchInAppPurchasesLocalizations(iapId: iap.id)
|
let localizations = await ascAPI.fetchInAppPurchasesLocalizations(iapId: iap.id)
|
||||||
for localization in product.localizations {
|
for localization in product.localizations {
|
||||||
|
ascAPI.addMessage("订阅商品已经存在:\(product.productId) ,跳过更新信息...")
|
||||||
|
return;
|
||||||
// 如果已经存在本地化语言,则更新
|
// 如果已经存在本地化语言,则更新
|
||||||
if let locale = localizations.filter({ $0.attributes?.locale == localization.locale }).first {
|
if let locale = localizations.filter({ $0.attributes?.locale == localization.locale }).first {
|
||||||
// 更新
|
// 更新
|
||||||
@ -466,6 +468,10 @@ extension APUploadIAPListVC {
|
|||||||
// 3、查看是否存在订阅商品,不存在就创建,存在就更新
|
// 3、查看是否存在订阅商品,不存在就创建,存在就更新
|
||||||
let subs = subscriptions.filter({ $0.attributes?.productID == product.productId })
|
let subs = subscriptions.filter({ $0.attributes?.productID == product.productId })
|
||||||
if let sub = subs.first {
|
if let sub = subs.first {
|
||||||
|
///不做更新
|
||||||
|
ascAPI.addMessage("订阅商品已经存在:\(product.productId) ,跳过更新信息...")
|
||||||
|
return;
|
||||||
|
|
||||||
ascAPI.addMessage("订阅商品已经存在:\(product.productId) ,开始更新信息中...")
|
ascAPI.addMessage("订阅商品已经存在:\(product.productId) ,开始更新信息中...")
|
||||||
// 0. 审核备注如果原来有值,而新字段无值,则使用原值
|
// 0. 审核备注如果原来有值,而新字段无值,则使用原值
|
||||||
var product = product
|
var product = product
|
||||||
|
|||||||
@ -198,11 +198,11 @@ extension APClient {
|
|||||||
filter = "fields[inAppPurchase]=referenceName,productId,inAppPurchaseType&filter[canBeSubmitted]=true&limit=500&sort=-referenceName&exists[inAppPurchaseReviewSubmission]=true&"
|
filter = "fields[inAppPurchase]=referenceName,productId,inAppPurchaseType&filter[canBeSubmitted]=true&limit=500&sort=-referenceName&exists[inAppPurchaseReviewSubmission]=true&"
|
||||||
}
|
}
|
||||||
return "https://appstoreconnect.apple.com/iris/v1/apps/"+appid+"/inAppPurchase?"+filter
|
return "https://appstoreconnect.apple.com/iris/v1/apps/"+appid+"/inAppPurchase?"+filter
|
||||||
// return "https://api.appstoreconnect.apple.com/v1/apps/\(appid)/inAppPurchasesV2"
|
|
||||||
case let .iaps(appid):
|
case let .iaps(appid):
|
||||||
return "https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/apps/"+appid+"/iaps"
|
return "https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/apps/"+appid+"/iaps"
|
||||||
case let .inAppPurchaseDetail(iapid):
|
case let .inAppPurchaseDetail(iapid):
|
||||||
return "https://appstoreconnect.apple.com/iris/v2/inAppPurchases/\(iapid)?include=inAppPurchaseLocalizations,content,promotedPurchase,appStoreReviewScreenshot,inAppPurchaseTaxCategoryInfo&limit[inAppPurchaseLocalizations]=200"
|
return "https://appstoreconnect.apple.com/iris/v2/inAppPurchases/\(iapid)?include=inAppPurchaseLocalizations,content,promotedPurchase,appStoreReviewScreenshot,inAppPurchaseTaxCategoryInfo&limit[inAppPurchaseLocalizations]=200"
|
||||||
|
// return "https://api.appstoreconnect.apple.com/v2/inAppPurchases/\(iapid)"
|
||||||
case let .inAppPurchasePrices(iapid):
|
case let .inAppPurchasePrices(iapid):
|
||||||
return "https://appstoreconnect.apple.com/iris/v2/inAppPurchases/\(iapid)/prices?include=inAppPurchasePricePoint&filter[territory]=USA"
|
return "https://appstoreconnect.apple.com/iris/v2/inAppPurchases/\(iapid)/prices?include=inAppPurchasePricePoint&filter[territory]=USA"
|
||||||
case .ascProvider:
|
case .ascProvider:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user