Skip to content

Commit ef3c64b

Browse files
committed
iOS install in readme + removed status checking
1 parent 2469da6 commit ef3c64b

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ with more granular customisation.
3232
## Installation
3333

3434
```bash
35-
$ npm install --save react-native-background-task
35+
$ npm install react-native-background-task --save
3636
```
3737

3838
### Android
@@ -53,11 +53,17 @@ $ npm install --save react-native-background-task
5353

5454
### iOS
5555

56-
Follow installation instructions for version 2.0.x of
56+
For iOS support, this package relies on version 2.0.x of
5757
[react-native-background-fetch](https://github.com/transistorsoft/react-native-background-fetch)
58+
which can be installed as follows:
59+
60+
```bash
61+
$ npm install [email protected] --save
62+
$ react-native link react-native-background-fetch
63+
```
5864

59-
This library will behave correctly on iOS as long as `react-native-background-fetch`
60-
is installed alongside it, and correctly linked.
65+
This package will behave correctly on iOS as long as `react-native-background-fetch`
66+
is installed alongside it, and has been linked with your project.
6167

6268
## API
6369

@@ -82,7 +88,7 @@ platform's scheduler.
8288
- Should be called from inside a component (e.g. your App's
8389
`componentDidMount`). This is to avoid double-scheduling when the task
8490
launches in headless mode.
85-
- Will `console.warn` if the device is restricting scheduling the task.
91+
- Will `console.warn` if the device is task was unable to be scheduled.
8692

8793
Parameters:
8894

js/index.ios.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,9 @@ const BackgroundTask: BackgroundTaskInterface = {
2323
{ stopOnTerminate: false },
2424
this._definition,
2525
() => {
26-
console.warn(`Device doesn't support Background Fetch`)
26+
console.warn(`Background Fetch failed to start`)
2727
}
2828
)
29-
30-
// Query the authorization status
31-
BackgroundFetch.status(status => {
32-
if (status === BackgroundFetch.STATUS_RESTRICTED) {
33-
console.warn('BackgroundFetch is restricted')
34-
} else if (status === BackgroundFetch.STATUS_DENIED) {
35-
console.warn('BackgroundFetch is denied')
36-
}
37-
})
3829
},
3930

4031
finish: function() {

0 commit comments

Comments
 (0)