-
In Xcode, in Project Navigator (left pane), right-click on the Libraries
> Add files to [project name]
. Add node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.xcodeproj
(screenshots).
(it may install RNN v2 inside react-native-navigation-v1-v2-adapter, in such case the path will be: node_modules/react-native-navigation-v1-v2-adapter/node_modules/react-native-navigation/lib/ios/ReactNativeNavigation.xcodeproj
-
In Xcode, in Project Navigator (left pane), click on your project (top), then click on your target row (on the "project and targets list", which is on the left column of the right pane) and select the Build Phases
tab (right pane). In the Link Binary With Libraries
section add libReactNativeNavigation.a
(screenshots).
-
In Xcode, you will need to edit this file: AppDelegate.m
. This function is the main entry point for your app:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... }
Its content should look like this:
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <ReactNativeNavigation/ReactNativeNavigation.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
[ReactNativeNavigation bootstrap:jsCodeLocation launchOptions:launchOptions];
return YES;
}
@end
-
Replace all navigation imports:
import {Navigation, ScreenVisibilityListener} from 'react-native-navigation';
With:
import {Navigation, ScreenVisibilityListener} from 'react-native-navigation-v1-v2-adapter';