As per documentation for app shortcuts
Rate Limiting When using the setDynamicShortcuts(), addDynamicShortcuts(), or updateShortcuts() methods, keep in mind that you might only be able to call these methods a specific number of times in a background app, an app with no activities or services currently in the foreground. In a production environment, you can reset this rate limiting by bringing your app to the foreground.
What is rate limiting in concern with app shortcuts? when isRateLimitingActive() should be used?
Looking at the source code it seems that the
isRateLimitingActive()
method returns false if you do not have any remaining calls left to theShortcutManager
API (hence the "0"). I guess rate limiting is needed because the API is resource intensive. I can imagine that at least the following will happen if you update a shortcut:You could use this method to find out if a call to
setDynamicShortcuts()
,addDynamicShortcuts()
orupdateShortcuts()
will succeed before even trying to do so.Source: