I'm working on creating App Shortcuts for my app to show up in the Shortcuts app and Spotlight. One new feature this year is the option to add your apps tint color as a background, but I'm not able to get this to work.
I have added the items NSAppIconActionTintColorName (String) and NSAppIconComplementingColorNames (Array?) to my info.plist file that where briefly mentioned in the WWDC23 video, but they don't seem to have any effect.
Has anyone got these to work in their project?
After a bit of help on Twitter, here's how to get this working:
-
Add the
shortTitle
andsystemImageName
parameters in yourAppShortcut()
. If none of your shortcuts have this, the coloured panel won't appear in Shortcuts app. The system image name is from SF Symbols. -
Create colours in your main app's asset catalog (e.g.
ShortcutsBackground1
,ShortcutsBackground2
andShortcutsForeground
-
Now add
NSAppIconActionTintColorName
andNSAppIconComplementingColorNames
in your Info.plist. This needs to go withinCFBundlePrimaryIcon
.
For example:
<dict>
.....
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
....
<key>NSAppIconActionTintColorName</key>
<string>ShortcutsForeground</string>
<key>NSAppIconComplementingColorNames</key>
<array>
<string>ShortcutsBackground1</string>
<string>ShortcutsBackground2</string>
</array>
</dict>
</dict>
</dict>