1
This commit is contained in:
parent
5a82e3c074
commit
ebbf12f9c4
@ -199,12 +199,17 @@ extension APInAppPurchseVC {
|
||||
// 检查内购品项是否后台已经创建过
|
||||
if iapList.isNotEmpty {
|
||||
let pids = iaps.map { $0.productId }
|
||||
let vendorIds = Set(iapList.map { $0.vendorId })
|
||||
let warns = pids.filter { vendorIds.contains($0) }
|
||||
let existsIAPs = Dictionary(uniqueKeysWithValues: iapList.map { ($0.vendorId, $0) })
|
||||
let warns = pids.filter { existsIAPs[$0] != nil }
|
||||
if warns.isNotEmpty {
|
||||
NSAlert.show("‼️警告:已经存在相同商品id的品项!请检查:\(warns)。\n⚠️提示:如果继续上传,将会覆盖已有品项的信息!")
|
||||
NSAlert.show("‼️警告:已经存在相同商品id的品项!请检查:\(warns)。\n⚠️提示:将仅保留元数据缺失和未上传的品项。")
|
||||
}
|
||||
newIAPs = iaps.filter {
|
||||
guard let existsIAP = existsIAPs[$0.productId] else {
|
||||
return true
|
||||
}
|
||||
return existsIAP.iTunesConnectStatus == .missingMetadata
|
||||
}
|
||||
newIAPs = iaps.filter { !vendorIds.contains($0.productId) }
|
||||
}
|
||||
|
||||
// 检查商品同名,苹果后台不允许存在同名
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user