File tree Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ with more granular customisation.
32
32
## Installation
33
33
34
34
``` bash
35
- $ npm install --save react-native-background-task
35
+ $ npm install react-native-background-task --save
36
36
```
37
37
38
38
### Android
@@ -53,11 +53,17 @@ $ npm install --save react-native-background-task
53
53
54
54
### iOS
55
55
56
- Follow installation instructions for version 2.0.x of
56
+ For iOS support, this package relies on version 2.0.x of
57
57
[ 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
+ ```
58
64
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 .
61
67
62
68
## API
63
69
@@ -82,7 +88,7 @@ platform's scheduler.
82
88
- Should be called from inside a component (e.g. your App's
83
89
` componentDidMount ` ). This is to avoid double-scheduling when the task
84
90
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 .
86
92
87
93
Parameters:
88
94
Original file line number Diff line number Diff line change @@ -23,18 +23,9 @@ const BackgroundTask: BackgroundTaskInterface = {
23
23
{ stopOnTerminate : false } ,
24
24
this . _definition ,
25
25
( ) => {
26
- console . warn ( `Device doesn't support Background Fetch ` )
26
+ console . warn ( `Background Fetch failed to start ` )
27
27
}
28
28
)
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
- } )
38
29
} ,
39
30
40
31
finish : function ( ) {
You can’t perform that action at this time.
0 commit comments