Skip to content

Commit

Permalink
📝 Update background observer docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ruan-azevedo committed Jan 16, 2023
1 parent c7fd726 commit 348ee42
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/background.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ following:
If you followed the [Background Processing](https://github.com/agencyenterprise/react-native-health#background-processing)
step in the README, you can skip this one.

To setup that in your project, in XCode open your `ios/AppDelegate.m` file and uncomment the
lines with a comment `Uncomment this line to use background observers`:
To setup that in your project, in XCode open your `ios/AppDelegate.m` file and add the
following statements:


```objective-c
#import "AppDelegate.h"

...

// #import "RCTAppleHealthKit.h" // <-- Uncomment this line to use background observers
/* Add the library import at the top of AppDelegate.m */
#import "RCTAppleHealthKit.h"

...

Expand All @@ -50,7 +51,8 @@ lines with a comment `Uncomment this line to use background observers`:

...

// [[RCTAppleHealthKit new] initializeBackgroundObservers:bridge]; // <-- Uncomment this line to use background observers
/* Add Background initializer for HealthKit */
[[RCTAppleHealthKit new] initializeBackgroundObservers:bridge];

...

Expand Down

0 comments on commit 348ee42

Please sign in to comment.