Unable to set the new App Tint Color options for App Shortcuts

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?

Answered by CrunchyBagel in 758365022

After a bit of help on Twitter, here's how to get this working:

  1. Add the shortTitle and systemImageName parameters in your AppShortcut(). If none of your shortcuts have this, the coloured panel won't appear in Shortcuts app. The system image name is from SF Symbols.

  2. Create colours in your main app's asset catalog (e.g. ShortcutsBackground1, ShortcutsBackground2 and ShortcutsForeground

  3. Now add NSAppIconActionTintColorName and NSAppIconComplementingColorNames in your Info.plist. This needs to go within CFBundlePrimaryIcon.

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>

I'm not sure they are available in the current betas and there is no documentation at the moment other than that part of the WWDC video. I also find it strange that these are plist keys when App Shortcuts / App Intents has been focussed on moving everything to swift. Maybe we will get these as some static vars on AppShortcutsProvider in a future beta instead of plist keys?

Accepted Answer

After a bit of help on Twitter, here's how to get this working:

  1. Add the shortTitle and systemImageName parameters in your AppShortcut(). If none of your shortcuts have this, the coloured panel won't appear in Shortcuts app. The system image name is from SF Symbols.

  2. Create colours in your main app's asset catalog (e.g. ShortcutsBackground1, ShortcutsBackground2 and ShortcutsForeground

  3. Now add NSAppIconActionTintColorName and NSAppIconComplementingColorNames in your Info.plist. This needs to go within CFBundlePrimaryIcon.

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>

In case it helps, after hours struggling, I discovered that I had to kill the Shortcuts App for changes to take effect!

Unable to set the new App Tint Color options for App Shortcuts
 
 
Q