How to conditionally add AppShortcut to appShortcuts list in AppShortcutsProvider

I am trying to add certain shortcuts based on user eligibility for a feature, however I get an error if i try to use conditions in appShortcuts of AppShortcutsProvider. if I use static list to update the shortcuts and use static shortcut list in appShortcuts of AppShortcutsProvider - shortcuts are not displayed. Can anyone help with an example to update appShortcuts of AppShortcutsProvider dynamically. Is that supported at all?

Here's another thread with some reasonable advice.

During the build of your app, metadata about your App Shortcuts is statically extracted at compile time from your source code and stored as part of your built app, so it's not possible to update this information at run time. If you'd like us to consider adding the necessary functionality for you to do so, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here.

— Ed Ford,  DTS Engineer

How to conditionally add AppShortcut to appShortcuts list in AppShortcutsProvider
 
 
Q