i am using SwiftyStoreKit SDK for in app purchase into my application
for some reason , the restore is not working and i am getting this message in xCode console
Log :
[BackgroundTask] Background Task 1 ("SKReceiptRefreshRequest"), was created over 30 seconds
ago. In applications running in the background, this creates a risk of termination. Remember to
call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
My restore purchase code :
SwiftyStoreKit.restorePurchases(atomically: true) { results in
if results.restoreFailedPurchases.count > 0 {
print("Restore Failed: \(results.restoreFailedPurchases)")
}
else if results.restoredPurchases.count > 0 {
SwiftyStoreKit.fetchReceipt(forceRefresh: true) { result in
switch result {
case .success(let receiptData):
let encryptedReceipt = receiptData.base64EncodedString(options: [])
print("Fetch receipt success:\n\(encryptedReceipt)")
case .error(let error):
print("Fetch receipt failed: \(error)")
}
}
print("Restore Success: \(results.restoredPurchases)")
}
else {
print("Nothing to Restore")
}
}
and its keep loading forever without any progress , any idea why ?