NSFileProviderExtension - fetchThumbnails() not called

Hi,

We are building a document based app that also has a file provider extenstion. We use the file provider extesntion to access remote PDF files. So far we are able to list the remote files, download and open (no problem), BUT we can't get fetchThumbnails() in our NSFileProviderExtension subclass to be called. We read that it is only called for remote files, thus we tried setting isDownloaded on our NSFileProviderItem's, but that did not work. Any other ideas?


Anybody here that has a working NSFileProviderExtension with thumbnails for remote files working?

Replies

Hi,


I think I solved the problem... I did not update the NSFileProviderItem versionIdentifier. When I do this fetchThumbnails() is called.


Kind Regrads,


Anders.

@anders.sejersbol I have tried updating the versionIdentifer but still haven't seen a call to fetchThumbnails in a while. Is it working consistenly for you now?

I agree, sometimes when I have updated the versionIdentifier (with a file content hash/md5) I don’t see fetchThumbnails called. I.e. no, it’s not working consistently for me :-(


However, if I erase all content and settings from the simulator, and install my app+file extension again, fetchThumbnails() will be called.


Does anyone know exactly what triggers fetchThumbnails() to be called? It looks like changing versionIdentifier is not always enough…

@anders.sejersbol


I can't say fetch thumbnails is working consistently now but I am getting thumbnails so that is good. I came in the next day after I my post and fetchThumbnails was all of the sudden being called again. I wonder if it gives up for a while after failures you encounter while debugging.


Hey, I was wondering how you are debugging your file extension in the simulator? I can't seem to make that work. I don't get an option to select the Files app when it brings up the "Ask on Launch" dialog. Are you attaching after you launch the files app?


I feel like there needs to be a File Provider development support group!


Ted

@tmrog36, fetchThumbnails() are alså working for me, but I have also had the thought that the OS backs off if it experiences failures.


I have two apps, one document based app and one single view app with the file provider extension. If I want to try/debug the document based app i launch this in the simulator, and if I want to try/debug the file provider extension I launch this in the document based app that I have already installed in the simulator. I use the Console.app and filter on process names, i.e. I only look at the process of my document based app and the file provider app. This setup works and it also works with the Files app being the document based app.


I agree, file providers are pretty complex and group for this subject alone would be nice.


Kind regards,


Anders.

+1 on this issue. There also seem to be image cashing issue with iOS 11, deeper under the hood. The version identifier should trigger fetchThumbnails every time it is incremented. Instead, no thumbnails or wrong thumbnails are shown.

Hi,


I am also stuck at fetchThumbnails. I looked into many docs, codes and there is nothing about it except apple docs.

I can enumerate files but I could not trigger fetchTHumbnail function.

I set also versionIdentifier but still cant trigger fetchThumbnail.


Do you have any examples or something else?


Sincerely

I have done a bunch more work in this area but can't say I have got fetchThumbnails to be call reliably. You may want to remove your app and restart the device. I have seen thumbnails generated on device restart. I think if you have failures it may stop asking for you for thumbnails until some "event" happens. Device restart seems to be one of those events.

oh my god. I listened you and I restart my simulator and It started to working.

Ok. Thanks for your advice.

Sincerely

I have the same issue but it seems that when i use simulator to run the app fetchThumbnails is being called properly but on actual device it is not being called. I dont know why.

It should be working. I have no problem even in real device.

did you try to remove your app and restart device?

well I updated the ios version and now its working.

As for me on simulator iOS 12 fetchThumbnails called each time i delete app and remove file provider from Files apps.
On device this doesn't work. But when i restart device as u write above, fetchThumbnails start calling. Thank you a lot