New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-rnbundlemerge

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-rnbundlemerge

## Getting started

latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

使用方法: 1、打开终端 进入项目根目录 输入命令: npm i react-native-rnbundlemerge 2、用xcode打开项目 在Libraries文件夹下添加node_modules->react-native-rnbundlemerge->ios->RNBundleLib->RNBundleLib.xcodeproj 3、在Build Phases->Link Binary With Libraries下添加libRNBundleLib.a 5、在sunsoftJyjf->Build Settings->Search Paths->Heaser Search Paths下添加$(SRCROOT)/../node_modules/react-native-rnbundlemerge/ios/RNBundleLib/Lib 6、在AppDelegate.h类里添加头文件 #import "SSManager.h" #import "Util.h" 并添加代理SSRNOperationDelegate,添加@property(nonatomic,strong)NSDictionary * launchOptions;属性

7、在AppDelegate.m类里添加两个方法

-(void)loadRN:(NSNotification *)noti{

[self reloadRN];

}

-(void)reloadRN{

NSURL *jsCodeLocation;

jsCodeLocation = [NSURL URLWithString:[SSManager sharedManager].jsLocation]; self.rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"sunsoftJyjf" initialProperties:nil launchOptions:self.launchOptions]; self.rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; }

在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法下添加如下代码: self.launchOptions = launchOptions; //接收到成功回调通知 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadRN:) name:@"reloadRN" object:nil]; //处理AppStore后数据更新 [Util dealWithAppStoreUpdateWithVersion:@"1.0.0" bundleVersion:@"1.0"]; //获取本地RN的地址 [SSManager sharedManager].delegate = self; [[SSManager sharedManager] beginBundleOperation:nil]; //加载RN [self reloadRN];

Keywords

merge

FAQs

Package last updated on 13 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts