Search code examples
javascriptmobilesimperium

Simperium and binary (image / video) asset files from JS


Simperium looks like an awesome way to sync data across a variety of platforms and to deal with on/offline access from mobile.

For a project I'm working on some of the data is in the form of generated image and video files. I can't find any information about whether it is possible to sync this kind of data through Simperium (I guess I could base64 encode the images but it seems like a hack).

Or would I need to sync the URLs and then manually download these resources and somehow store them locally?


Solution

  • Simperium has basic support for binary files on the iOS side, currently in testing. This isn't yet available in the JavaScript library, but it will be. The way it works is similar to what you described. Simperium can handle the syncing of both a URL and its associated binary content in cases where that makes sense.

    On iOS, binary files are stored to the local file system (though small files can indeed be stored as base64 encoded strings if you prefer).

    In JavaScript, if you're working on the client side, the situation is less clear given the storage limits imposed by browsers, but you always have the option of syncing and using standard links depending on what you're trying to do. On the server side, there are of course more options. If you have some uses cases to share, you should get in touch.