Skip to main content
Language

From Remote URL

PhotoEditor SDK supports loading photo files from a remote URL, this can be a resource hosted by a photo hosting provider such as Vimeo or Wistia or your own servers.

Download the remote photo#

Although you can pass a URL directly to the editor, we strongly recommend that you manage downloading the remote resource yourself. This allows for more control over where and how the download task is being executed and avoids potential problems around UI locking.

Hence we download the photo using the expo-file-system module before loading it into the editor.

Open the editor#

When the download is finished we load the local photo URL into the editor and open it. Once the photo has been exported, we handle the event and possible occurring errors.

Handle user interaction#

For this example, we are using Recoil and Recoil Nexus state management to disable user interaction while the download task is executing. In production, you might want to indicate download progress here. When the download has finished, we can reenable user interaction and dismiss the progress indicator.