How to add icons for widget configuration intents

Hi, I'm wondering how to add icons for widget configuration intents, like the Shortcuts looks.

imgur.com/a/qjPNfY4

Any help would be appreciated.

Replies

In the intentdefinition file you must set the parameter to Dynamic (check the Options are provided dynamically).
Then you must have an intent extension that return the custom values (inside the provideXXXXOptionsCollection) (see https://developer.apple.com/documentation/widgetkit/making-a-configurable-widget for doc about custom widgets). You must generate an array of INObject with the possible value for the parameter. To set an image for a item you must set the property displayImage of the INObject.
I set the property displayImage ("image:" label) of the INObject like the below.
Code Block
Card(identifier: card.cardName,
     display:    card.cardName,
     subtitle:   card.cardNumber,
     image: INImage(url: URL(string: card.cardImageUrl)!))

The selection list is displayed correctly.
However the selected card image is not displayed in the Edit Widget screen.
Edit Widget screen

I put the codes on my GitHub.
https://github.com/hackenbacker/FictionalCard

Any help would be appreciated.
@Hackenbacker - did you ever solve this? It looks like you're doing everything correctly.

It is almost as if the image is meant to just be a template, and will then be coloured in the widget's tint colour - even though it shows in its original colour on the list screen.
@Hackenbacker Did you solve this problem? It looks like I'm having the same problem now, where the images displayed in the select list are perfectly fine, but the images are not displayed in the Edit Widget screen.