1

Is it possible to load an image from remote in the Live Activity using ActivityKit? I tried various different methods, but none of them are working including:

  • AsyncImage
  • Pre-fetching the image in the App and passing that image to Activity as a Data through the context when starting the activity and converting Data back to the Image
user1258202
  • 170
  • 2
  • 9

2 Answers2

2

I assume you hit the 4KB size limit the docs warn us about.

We are not allowed to make network requests from inside Live Activity widgets, thus the only viable option you have is downloading the image in the App.

Depending on the type of image you use, I advise you find some way to reduce their size by either downscaling, using vectors etc.

Good luck!

davidtamas
  • 31
  • 3
0

I managed to share images from my main app to the Live Activity or Dynamic Island via Core Data.

However for some reason it works fine on Simulator but it doesn't work at all on real device.

The Live activity starts without error, but it doesn't appear on Lock Screen as well as the Dynamic Island.

Sharing an Array of Data containing images, looks like resulting in an error while starting the Activity.

So I really have no clue at this point.

Pietro Messineo
  • 777
  • 8
  • 28