Offline Use - Component (In app browser)

Hello,

There is a code: Fliplet.Navigate.file(fileUrl)

I am not actually sure where I got it anymore lol but it opens the in app browser that fliplet made.

If I have a cached file, and its offline, lets say a pdf - is ther a simple way to view it?

normally I have the url from the datasource (url of the file in file manager) - lets say a pdf. If I want the user to open it (online) I use: Fliplet.Navigate.file(fileUrl)

but if offline, what is an alternative?
what is a good way to store the file in cache?

Hi Chase,

You can use these JS API’s to download the file for offline use: Media JS APIs | Fliplet Developers Documentation

This method will return the offline/online url to the file that you can to open the file:

Hope this helps,
Deb

Hi Deb,

Thanks so much for your guidance! I reviewed your response and implemented the offline caching via the Fliplet Media JS APIs. I noticed that using Fliplet.Navigate.file(fileUrl) provides a full in-app browser experience when accessing files online.

When I switch to offline mode using the caching approach, am I still responsible for rendering the file? For example, I might need to generate my own UI element, such as an iframe—for instance:

<iframe src="[[blobUrl]]" style="width:100%; height:100%; border:none;"></iframe>

Is that the correct approach for offline viewing, or does Fliplet offer any built-in method to render cached files in a similar in-app browser experience?

Thanks again for your help!

Hi Chase,

No, we don’t have the native ability to render offline files. But we have tested pdf.js to render files in screen before and it has worked, I suggest you can try that. This should work offline and online.

See here: PDF.js - Examples

Thanks,
Deb

1 Like