There is no content for SKDownload.contentURL

Hello everybody,

we are currently integrating IAP into our app. To do this, we also need hosted content. In detail, this is a database that is stored in the IAP content target under /Contents/offline.db. The content has been correctly uploaded and linked to the IAP product and appears to be being downloaded. There are no mistakes.

However, it is not possible for us to access the content after the download. The directory or file does not exist.


Code Block
switch download.state {
case SKDownloadState.finished:
  let urls = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)
  print("cachURL = ", urls[0].absoluteString)
  print("cachURL exists = ", FileManager.default.fileExists(atPath: urls[0].path))
  if let url = download.contentURL {
  print("contentURL = ", url.absoluteString)
    print("contentURL exists = ", FileManager.default.fileExists(atPath: url.path))
}
SKPaymentQueue.default().finishTransaction( download.transaction)


This produces the following output:

Code Block
cachURL =  file:///var/mobile/Containers/Data/Application/D8B31BFF-5511-4484-A719-5B5A07A5828A/Library/Caches/
cachURL exists =  true
contentURL =  file:///private/var/mobile/Containers/Data/Application/2F831210-3EED-41E8-98AD-A3CCDA4DE1A8/Library/Caches/StoreKit/3838527003437181156/
contentURL exists =  false


Does anyone know what our problem is?

Thanks in advice
Andreas

Test device: iPhone 8 iOS 14.4.2
There is no content for SKDownload.contentURL
 
 
Q