UNPKG

2.34 kBTypeScriptView Raw
1/**
2 * This return value is to let iOS know what the result of your background fetch was, so the
3 * platform can better schedule future background fetches. Also, your app has up to 30 seconds
4 * to perform the task, otherwise your app will be terminated and future background fetches
5 * may be delayed.
6 */
7export declare enum BackgroundFetchResult {
8 /**
9 * There was no new data to download.
10 */
11 NoData = 1,
12 /**
13 * New data was successfully downloaded.
14 */
15 NewData = 2,
16 /**
17 * An attempt to download data was made but that attempt failed.
18 */
19 Failed = 3
20}
21export declare enum BackgroundFetchStatus {
22 /**
23 * The user explicitly disabled background behavior for this app or for the whole system.
24 */
25 Denied = 1,
26 /**
27 * Background updates are unavailable and the user cannot enable them again. This status can occur
28 * when, for example, parental controls are in effect for the current user.
29 */
30 Restricted = 2,
31 /**
32 * Background updates are available for the app.
33 */
34 Available = 3
35}
36export interface BackgroundFetchOptions {
37 /**
38 * Inexact interval in seconds between subsequent repeats of the background fetch alarm. The final
39 * interval may differ from the specified one to minimize wakeups and battery usage.
40 * - On Android it defaults to __10 minutes__,
41 * - On iOS it calls [`BackgroundFetch.setMinimumIntervalAsync`](#backgroundfetchsetminimumintervalasyncminimuminterval)
42 * behind the scenes and the default value is the smallest fetch interval supported by the system __(10-15 minutes)__.
43 * Background fetch task receives no data, but your task should return a value that best describes
44 * the results of your background fetch work.
45 * @return Returns a promise that fulfils once the task is registered and rejects in case of any errors.
46 */
47 minimumInterval?: number;
48 /**
49 * Whether to stop receiving background fetch events after user terminates the app.
50 * @default true
51 * @platform android
52 */
53 stopOnTerminate?: boolean;
54 /**
55 * Whether to restart background fetch events when the device has finished booting.
56 * @default false
57 * @platform android
58 */
59 startOnBoot?: boolean;
60}
61//# sourceMappingURL=BackgroundFetch.types.d.ts.map
\No newline at end of file