まず、 "react-native bundle"コマンドを使用してバンドルを作成します。今、あなたはmain.jsbundleを取得します。
次に、main.jsbundleをxcodeプロジェクトに配置し、リソースのように追加します。
最後に、RCTBridgeを使用してRCTRootViewを初期化し、デリゲート "sourceUrlForBridge"を実装してください。
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
// NSString *jsBundlePath = @"http://localhost:8081/index.ios.bundle?platform=ios&dev=true";
// NSURL *jsBundleURL = [NSURL URLWithString:jsBundlePath];
NSString *path = [[NSBundle mainBundle] pathForResource:@"main" ofType:@"jsbundle"];
NSURL *jsBundleURL = [NSURL URLWithString:path];
return jsBundleURL;
}