I’m trying to integrate react-native-health into my React Native 0.77+ project, but the documentation only shows setup instructions for Objective-C AppDelegate. My project uses Swift AppDelegate (which is the default for RN 0.77+).
The Problem
The react-native-health documentation shows this Objective-C setup:
objc
The Problem
The react-native-health documentation shows this Objective-C setup:
objc#import "AppDelegate.h"
#import "RCTAppleHealthKit.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
launchOptions:launchOptions];
/* Add Background initializer for HealthKit */
[[RCTAppleHealthKit new] initializeBackgroundObservers:bridge];
return YES;
}
What I've Tried
Added #import "RCTAppleHealthKit.h" to my bridging header
Installed the pod and added HealthKit capabilities
Added HealthKit usage descriptions to Info.plist
But I'm struggling with how to properly initialize the background observers in Swift, especially with my custom React Native setup using RCTReactNativeFactory.
Questions
How do I properly initialize RCTAppleHealthKit background observers in Swift AppDelegate?
How do I get access to the RCT bridge instance from my custom factory setup?
Is there a different approach needed for React Native 0.77+ projects?
What I’ve Tried
Added #import “RCTAppleHealthKit.h” to my bridging header
Installed the pod and added HealthKit capabilities
Added HealthKit usage descriptions to Info.plist
But I’m struggling with how to properly initialize the background observers in Swift, especially with my custom React Native setup using RCTReactNativeFactory.
Questions
How do I properly initialize RCTAppleHealthKit background observers in Swift AppDelegate?
How do I get access to the RCT bridge instance from my custom factory setup?
Is there a different approach needed for React Native 0.77+ projects?
Any help would be greatly appreciated!

