Getting Thumbnails for a URL in iCloud Drive Directory

I'm new to working with URL resourceValues and curious if there's some trick to retrieve thumbnails from a URL in iCloud Drive.

do {
    let values = try fileUrl.promisedItemResourceValues(forKeys: [.thumbnailDictionaryKey])
    if let dictionary = values.thumbnailDictionary {

        print(dictionary)
    } else {
        print("UNABLE TO GET THE THUMBS")
    }
}
catch {
    print(error)
}


On first run, despite using "promisedItemResourceValues", the thumbnails are not retrieved the first time this code is executed. The second time this code is triggered by the user it will successfuly return thumbnails.
It appears that the thumbnails are loaded in the background after executing "promisedItemResourceValues", but I don't know when to try again. Should I resort to polling for the thumbnails? It introduces problems like: how long should I poll before assuming the network timed-out?

I feel like I'm following the documentation, but getting wrong results. Am I approaching this wrong?