Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 587 Bytes

File metadata and controls

28 lines (18 loc) · 587 Bytes

@alexandersandberg/react-native-begin-background-task

⚠️ Note: This only works on iOS and will be ignored on other platforms.

Installation

npm i @alexandersandberg/react-native-begin-background-task

then...

npx pod-install

Usage

import { beginBackgroundTask, endBackgroundTask } from '@alexandersandberg/react-native-begin-background-task';

// ...

const backgroundTaskId = await beginBackgroundTask();

// Your task that you want to keep running if the app goes to the background...

await endBackgroundTask(backgroundTaskId)