android-components / mozilla.components.feature.pwa / WebAppShortcutManager

WebAppShortcutManager

class WebAppShortcutManager (source)

Constructors

Name Summary
<init> WebAppShortcutManager(context: <ERROR CLASS>, httpClient: Client, storage: ManifestStorage = ManifestStorage(context), supportWebApps: Boolean = true)

Functions

Name Summary
buildBasicShortcut fun buildBasicShortcut(context: <ERROR CLASS>, session: Session, overrideShortcutName: String? = null): ShortcutInfoCompat
Create a new basic pinned website shortcut using info from the session. Consuming SHORTCUT_CATEGORY in AndroidManifest is required for the package to be launched
buildWebAppShortcut suspend fun buildWebAppShortcut(context: <ERROR CLASS>, manifest: WebAppManifest): ShortcutInfoCompat?
Create a new Progressive Web App shortcut using a web app manifest.
findShortcut fun findShortcut(context: <ERROR CLASS>, startUrl: String): Nothing?
Finds the shortcut associated with the given startUrl. This method can be used to check if a web app was added to the homescreen.
requestPinShortcut suspend fun requestPinShortcut(context: <ERROR CLASS>, session: Session, overrideShortcutName: String? = null): Unit
Request to create a new shortcut on the home screen.
uninstallShortcuts suspend fun uninstallShortcuts(context: <ERROR CLASS>, startUrls: List<String>, disabledMessage: String? = null): Unit
Uninstalls a set of PWAs from the user’s device by disabling their shortcuts and removing the associated manifest data.
updateShortcuts suspend fun updateShortcuts(context: <ERROR CLASS>, manifests: List<WebAppManifest>): Unit
Update existing PWA shortcuts with the latest info from web app manifests.