Issues loading Images Xcode Swift 5 (SDWebImage/Backblaze used)

382 Views Asked by At

i am encountering a weird issue. Short version

  • We have an app in the appstore for multiple months now with a photo feed. We have plenty of users (99,9% in Europe, mostly Central Europe).
  • using SDwebImage for image downloading
  • Backblaze as cloud storage

The issue: On our end there is no issue. And none of our users encounter issues when showing the images. However when Apple reviews our app, they are not able to download images at all (the exact same which work for us and all users).

What we tested

  • SDWebImage was shortly replaced with Kingfisher -> same result
  • We tried to reproduce the issue but weren't able: We set the location of our simulator to all possible locations + changed languages, clean rebuild etc. Never encountered the issue.
  • We tried around with AllowArbitrary loads but still won't work for our Apple reviewer.

Code

            postImageView.sd_imageIndicator?.startAnimatingIndicator()
        
        let photoUrl = URL(string: photoUrlString)
        postImageView.backgroundColor = .systemGray3
        postImageView.sd_imageIndicator = SDWebImageActivityIndicator.grayLarge
        
        SDWebImageDownloader.shared.config.downloadTimeout = 40
        postImageView.sd_setImage(with: photoUrl, placeholderImage: nil, options: .allowInvalidSSLCertificates) { (image, err, sd, url) in
            self.postImageView.sd_imageIndicator = nil
            self.postImageView.sd_imageIndicator?.stopAnimatingIndicator()
            if err != nil {
                self.postImageView.image = UIImage(named: "placeholder-image")
                Ref().databaseProblems.child("IMAGE_IOS").child(UUID().uuidString).setValue("\(err.debugDescription) + \(err?.localizedDescription ?? "")")
                
            }
        }

the error codes

Optional(Error Domain=NSURLErrorDomain Code=-1001 \"The request timed out.\" UserInfo={_kCFStreamErrorCodeKey=60, NSUnderlyingError=0x28334f120 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 \"(null)\" UserInfo={_kCFStreamErrorCodeKey=60, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <49574986-C917-4980-ABC7-6A9E9EBD6892>.<3>, _NSURLErrorRelatedURLSessionTaskErrorKey=(\n    \"LocalDataTask <49574986-C917-4980-ABC7-6A9E9EBD6892>.<3>\"\n), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://f000.backblazeb2.com/file/Images/-MVVvWz3rlPQw5J5_Ah_, NSErrorFailingURLKey=https://f000.backblazeb2.com/file/Images/-MVVvWz3rlPQw5J5_Ah_, _kCFStreamErrorDomainKey=1}) + The request timed out."


"Optional(Error Domain=SDWebImageErrorDomain Code=2002 \"Operation cancelled by user during sending the request\" UserInfo={NSLocalizedDescription=Operation cancelled by user during sending the request}) + Operation cancelled by user during sending the request"


"Optional(Error Domain=NSURLErrorDomain Code=-1022 \"The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.\" UserInfo={NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection., NSErrorFailingURLStringKey=http://f000.backblazeb2.com/file/Images/-MVTKiJrFDOldW94d0cO, NSErrorFailingURLKey=http://f000.backblazeb2.com/file/Images/-MVTKiJrFDOldW94d0cO, _NSURLErrorRelatedURLSessionTaskErrorKey=(\n    \"LocalDataTask <F3ADD147-226D-48EF-8B3A-2C61EF2887FE>.<2>\"\n), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <F3ADD147-226D-48EF-8B3A-2C61EF2887FE>.<2>, NSUnderlyingError=0x60400036d550 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 \"(null)\"}}) + The resource could not be loaded because the App Transport Security policy requires the use of a secure connection."

info.plist

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>https://f000.backblazeb2.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
        </dict>
    </dict>

Any idea/suggestion?

0

There are 0 best solutions below