- We'll start by opening the iOS Project in Xcode, located in the ios directory of the new React Native app.
- Let's add a new Cocoa class file named BackgroundTaskManager of subclass NSObject. Refer to the Exposing Custom iOS Modules recipe in this chapter for more details on doing this in Xcode.
- Next, lets wire the new module to the React RCTBrideModule in the new module's header file, BackgroundTaskManager.h. The code to be added is marked in bold in the following snippet:
#import <Foundation/Foundation.h>#import <dispatch/dispatch.h>#import "RCTBridgeModule.h"@interface BackgroundTaskManager : NSObject <RCTBridgeModule> { dispatch_queue_t backgroundQueue;}@end
- We'll implement the native module in the BackgroundTaskManager.m ...