Search code examples
androidiosphotoeditorsdk

PhotoEditorSDK: Add custom overlays from server


We are using the PhotoEditorSDK on iOS and Android and include custom overlays. Currently, we add the custom overlays by adding them to our main bundle and then providing a URL to them (as described in the PESDK documentation).

Is it possible to add these custom overlays if the assets are stored on a server rather than being added to the main bundle?

Essentially, we'd like to be able to change the assets on the server and have the apps reflect that rather than having to push a new version to the app store when the custom overlays need to change.


Solution

  • On iOS the url and thumbnailURL of an Overlay can definitely be a remote URL but keep in mind that the images will be cached in memory and on disk, so it isn't guaranteed that new images will be downloaded if you replace them on the server without changing the name.

    To work around this my suggestion is that you create your own logic to make a server call which fetches information about new overlays. From that you create instances of Overlay and populate the Overlay.all array.