跳到主要内容

bn.onBackgroundFetchData

onBackgroundFetchData(callback): void

description Listen on backgroundFetch getting data event. If the event has finished when listening on, it will not be triggered.

example

bn.onBackgroundFetchData((res) => {
const { fetchType, fetchedData, timeStamp } = res
})

Parameters

NameType
callbackOnBackgroundFetchDataCallback

Returns

void

OnBackgroundFetchDataCallback

Ƭ OnBackgroundFetchDataCallback: (result: { fetchType: "periodic" | "pre" ; fetchedData: string ; timeStamp: number }) => void

Type declaration

▸ (result): void

Parameters

NameTypeDescription
resultObject-
result.fetchType"periodic" | "pre"Cache data category, with a value of periodic or pre
result.fetchedDatastringCache data
result.timeStampnumberThe timestamp of client getting the cached data

Returns

void