UNPKG

@capawesome/capacitor-badge

Version:

Capacitor plugin to access and update the badge number of the app icon.

242 lines 6.13 kB
{ "api": { "name": "BadgePlugin", "slug": "badgeplugin", "docs": "", "tags": [], "methods": [ { "name": "get", "signature": "() => Promise<GetBadgeResult>", "parameters": [], "returns": "Promise<GetBadgeResult>", "tags": [], "docs": "Get the badge count.\nThe badge count won't be lost after a reboot or app restart.\n\nDefault: `0`.", "complexTypes": [ "GetBadgeResult" ], "slug": "get" }, { "name": "set", "signature": "(options: SetBadgeOptions) => Promise<void>", "parameters": [ { "name": "options", "docs": "", "type": "SetBadgeOptions" } ], "returns": "Promise<void>", "tags": [], "docs": "Set the badge count.", "complexTypes": [ "SetBadgeOptions" ], "slug": "set" }, { "name": "increase", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [], "docs": "Increase the badge count.", "complexTypes": [], "slug": "increase" }, { "name": "decrease", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [], "docs": "Decrease the badge count.", "complexTypes": [], "slug": "decrease" }, { "name": "clear", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [], "docs": "Clear the badge count.\n\nOn **iOS**, this will remove the badge and also clear all notifications.", "complexTypes": [], "slug": "clear" }, { "name": "isSupported", "signature": "() => Promise<IsSupportedResult>", "parameters": [], "returns": "Promise<IsSupportedResult>", "tags": [], "docs": "Check if the badge count is supported.", "complexTypes": [ "IsSupportedResult" ], "slug": "issupported" }, { "name": "checkPermissions", "signature": "() => Promise<PermissionStatus>", "parameters": [], "returns": "Promise<PermissionStatus>", "tags": [], "docs": "Check permission to display badge.", "complexTypes": [ "PermissionStatus" ], "slug": "checkpermissions" }, { "name": "requestPermissions", "signature": "() => Promise<PermissionStatus>", "parameters": [], "returns": "Promise<PermissionStatus>", "tags": [], "docs": "Request permission to display badge.", "complexTypes": [ "PermissionStatus" ], "slug": "requestpermissions" } ], "properties": [] }, "interfaces": [ { "name": "GetBadgeResult", "slug": "getbadgeresult", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "count", "tags": [], "docs": "", "complexTypes": [], "type": "number" } ] }, { "name": "SetBadgeOptions", "slug": "setbadgeoptions", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "count", "tags": [], "docs": "The badge count to set.\n\nOn **iOS**, setting the count to `0` will remove the badge and also clear all notifications.", "complexTypes": [], "type": "number" } ] }, { "name": "IsSupportedResult", "slug": "issupportedresult", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "isSupported", "tags": [], "docs": "", "complexTypes": [], "type": "boolean" } ] }, { "name": "PermissionStatus", "slug": "permissionstatus", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "display", "tags": [], "docs": "Permission state of displaying the badge.", "complexTypes": [ "PermissionState" ], "type": "PermissionState" } ] } ], "enums": [], "typeAliases": [ { "name": "PermissionState", "slug": "permissionstate", "docs": "", "types": [ { "text": "'prompt'", "complexTypes": [] }, { "text": "'prompt-with-rationale'", "complexTypes": [] }, { "text": "'granted'", "complexTypes": [] }, { "text": "'denied'", "complexTypes": [] } ] } ], "pluginConfigs": [ { "name": "Badge", "slug": "badge", "properties": [ { "name": "persist", "tags": [ { "text": "true", "name": "default" }, { "text": "true", "name": "example" } ], "docs": "Configure whether the plugin should restore the counter after a reboot or app restart.\n\nOnly available on Android and iOS.", "complexTypes": [], "type": "boolean | undefined" }, { "name": "autoClear", "tags": [ { "text": "false", "name": "default" }, { "text": "false", "name": "example" } ], "docs": "Configure whether the plugin should reset the counter after resuming the application.\n\nOn **iOS**, this will also clear all notifications.\n\nOnly available on Android and iOS.", "complexTypes": [], "type": "boolean | undefined" } ], "docs": "These configuration values are available:" } ] }