How can I use an image for my live activity smartstack layout?

Hello, I am updating my live activity for the new ios18 Smart Stack functionality. I got it working through the WWDC session (Bring your live activities to Apple watch).

I'm doing supplementalActivityFamilies([.small]) and then a custom layout in the .small ActivityFamily

However, any images I try to use in the Smart Stack just show up as grey squares. (it works on the phone live activity)

I suspect it's because my app images are not moved over to the watch? Because I don't have a watch app and such no watch target?

If anyone can help me understand if there's anything I can do in order to have a custom image show up on the smart stack, I'd be very grateful.

Answered by Frameworks Engineer in 808382022

That is a good possibility based on your findings. If the images are larger than necessary, you can run into problems.

I made that mistake more than once; I used pretty large images and then used the resizable() modifier and thought everything would work. But no, it only works within reason.

Hi @Mathias_!

You can definitely use images without having a Watch app. What format are the image files? PNG? Something else?

Hey, thanks for responding so quickly.

Yeah we only have png images. They're defined as a resource in the widget target. I have found one resource that works that I was using in the "minimal" view, but other images that are in the same resource collection don't work.

Could it be a size issue?

Accepted Answer

That is a good possibility based on your findings. If the images are larger than necessary, you can run into problems.

I made that mistake more than once; I used pretty large images and then used the resizable() modifier and thought everything would work. But no, it only works within reason.

How can I use an image for my live activity smartstack layout?
 
 
Q