UIApplicationShortcutItem not showing base on Info.plist

465 Views Asked by At

I have 5 items defined in my plist. It only showed 4. ‍♂️

I've tried in Simulator and the actual iPhone XS Max.

    <array>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>home</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Home</string>
            <key>UIApplicationShortcutItemType</key>
            <string>homePressed</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>security</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Security</string>
            <key>UIApplicationShortcutItemType</key>
            <string>securityPressed</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>alert</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Alert</string>
            <key>UIApplicationShortcutItemType</key>
            <string>alertPressed</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>network</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Network</string>
            <key>UIApplicationShortcutItemType</key>
            <string>networkPressed</string>
        </dict>
        <dict>
            <key>UIApplicationShortcutItemIconFile</key>
            <string>settings</string>
            <key>UIApplicationShortcutItemTitle</key>
            <string>Settings</string>
            <key>UIApplicationShortcutItemType</key>
            <string>settingsPressed</string>
        </dict>
    </array>

Result

enter image description here

Am I doing anything wrong ?

2

There are 2 best solutions below

1
On BEST ANSWER

According to Apple:

The system limits the number of quick actions displayed when a user presses a Home screen app icon. Within the limited set of displayed quick action titles, your static quick actions are shown first, starting at the topmost position in the list. If your static items do not consume the permissible number for display and you have also defined dynamic quick actions using this class, then one or more of your dynamic quick actions is displayed.

That is, the system dictates the maximum number of items displayed and picks the first n items you provide for display.

I can't find anywhere the exact limit is shown, but I havn't seen any app have more than 4 items + the "share" item.

7
On

I think there is a limit of four items, looking into the documents

The system limits the number of quick actions displayed when a user presses a Home screen app icon. Within the limited set of displayed quick action titles, your static quick actions are shown first, starting at the topmost position in the list. If your static items do not consume the permissible number for display and you have also defined dynamic quick actions using this class, then one or more of your dynamic quick actions is displayed.

UPDATE discussion about the Share item:

Apparently iOS adds SHARE automatically BUT only if the app is installed from Appstore. – kyo

which make them four + the share item, as AppStore automatically have share application item added on each downloaded application