hi ,the detail i put it to answer
Post
Replies
Boosts
Views
Activity
All Question is on IAP Sandbox Test
Question one: unfinished transation never Automatic trigger ,such as when I start up again,i can not fetch the unfinished transations in the Transaction.updates?
/// - Returns: Task
func listenForTransactions() -> Task<Void, Error> {
return Task.detached {
//Iterate through any transactions which didn't come from a direct call to `purchase()`.
for await result in Transaction.updates {
do {
let transaction = try self.checkVerified(result)
//Deliver content to the user.
await self.updatePurchasedIdentifiers(transaction)
//Always finish a transaction.
await transaction.finish()
} catch {
//StoreKit has a receipt it can read but it failed verification. Don't deliver content to the user.
print("AAAA=Transaction failed verification")
}
}
}
}
Question Two: i call transaction.finish() after purchae success,but, when i user Transaction.unfinished to fetch all unfinished transations, the transaction still exist. the count of unfinished is growing
func restore() async {
try? await AppStore.sync()
await self.restoreProducts()
}
func restoreProducts() async {
var count:Int = 0
for await result in Transaction.unfinished {
//Don't operate on this transaction if it's not verified.
if case .verified(let transaction) = result {
//Check the `productType` of the transaction and get the corresponding product from the store.
switch transaction.productType {
case .nonConsumable:break
case .autoRenewable:
count += 1
case .nonRenewable:break
default:
//This type of product isn't displayed in this view.
break
}
}
}
print("unfinished = \(count)")
}
Question There:how can i verified jws myself, not call the autoVafified api you provide, can you has some demo?
thanks
you can do like this via cocoapods
spec.resource_bundles = {'PodName' => ['Source/*.xcprivacy']}
try cocoapods-privacy! you can use this auto manager NSPrivacyAccessedAPITypes for cocoapods component and project. https://github.com/ymoyao/cocoapods-privacy
this is a cocoapods plugin to manager privacy Manifest .https://github.com/ymoyao/cocoapods-privacy
you can use 'pod install --privacy' by cocoapods-privacy, it will auto create PrivacyInfo.xcprivacy file and search NSPrivacyAccessedAPITypes. https://github.com/ymoyao/cocoapods-privacy
The SDK only needs to care about its own core code, not child dependencies,same to project! There has a plugin cocoapods-privacy(https://github.com/ymoyao/cocoapods-privacy) that can auto create and manager privacy api, If useful, you can give a small star~