Path: blob/main/files/en-us/web/api/backgroundfetchmanager/get/index.md
6516 views
------{{APIRef("Background Fetch API")}}{{SeeCompatTable}}
The get() method of the {{domxref("BackgroundFetchManager")}} interface returns a {{jsxref("Promise")}} that resolves with the {{domxref("BackgroundFetchRegistration")}} associated with the provided id or {{jsxref("undefined")}} if the id is not found.
Syntax
Parameters
id: the ID of a {{domxref("backgroundFetchRegistration")}} defined by calling {{domxref("BackgroundFetchRegistration.fetch","fetch()")}}.
Return value
A {{jsxref("Promise")}} that resolves with a {{domxref("BackgroundFetchRegistration")}} or {{jsxref("undefined")}}.
Examples
The following examples shows how to use get() to retrieve a {{domxref("BackgroundFetchRegistration")}}. With an active {{domxref('ServiceWorker', 'service worker')}}, use the {{domxref('ServiceWorkerRegistration.backgroundFetch')}} to access the BackgroundFetchManager object and call its get() method.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}