1.0.5 • Published 4 years ago

rn-background-execution v1.0.5

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

rn-background-execution

This method requests additional background execution time for your app. Call this method when leaving a task unfinished might be detrimental to your app’s user experience. For example, call this method before writing data to a file to prevent the system from suspending your app while the operation is in progress.

Getting started

$ npm install rn-background-execution --save

Mostly automatic installation

$ react-native link rn-background-execution

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesrn-background-execution and add RNBackgroundExecution.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNBackgroundExecution.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Usage

import RNBackgroundExecution from 'rn-background-execution';

// Mark the start of a task that should continue if the app enters the background.
RNBackgroundExecution.beginBackgroundTask().then((error) => {
  // Callback after remaining background time expires.
});

// Marks the end of a specific long-running background task.
RNBackgroundExecution.endBackgroundTask();
1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago