1
This commit is contained in:
@@ -255,12 +255,17 @@ internal class StoreKitService: ObservableObject {
|
||||
switch result {
|
||||
case .success(let verification):
|
||||
do {
|
||||
let payload = verification.jwsRepresentation
|
||||
let transaction = try verifyPurchase(verification)
|
||||
|
||||
await printProductDetails(product)
|
||||
// 打印详细的交易信息
|
||||
await printTransactionDetails(transaction)
|
||||
|
||||
await MainActor.run {
|
||||
self.delegate?.service(self, didCompletePurchaseFor: transaction.productID, payload: payload)
|
||||
}
|
||||
|
||||
// 先完成交易
|
||||
await transaction.finish()
|
||||
|
||||
@@ -561,11 +566,13 @@ internal class StoreKitService: ObservableObject {
|
||||
// 持续监听,直到任务被取消
|
||||
while !Task.isCancelled {
|
||||
// 检查所有订阅的状态(并行检查,提高效率)
|
||||
let now = Date()
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
|
||||
formatter.timeZone = TimeZone.current
|
||||
print("当前订阅检测时间: \(formatter.string(from: now))")
|
||||
if self.config.showLog {
|
||||
let now = Date()
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
|
||||
formatter.timeZone = TimeZone.current
|
||||
print("当前订阅检测时间: \(formatter.string(from: now))")
|
||||
}
|
||||
await self.checkSubscriptionStatus()
|
||||
|
||||
// 等待指定间隔(默认30秒)后再次检查
|
||||
|
||||
Reference in New Issue
Block a user