-
Notifications
You must be signed in to change notification settings - Fork 0
Plain Unity Expo Integration with ejected RN
Shaunak Das edited this page Dec 3, 2017
·
3 revisions
- Create a project CRNA command.
- Eject from expo using this link
npm i -g react-native-cli
# or
yarn global add react-native-cli
npm run eject
When asked for type of eject, select the plain react native project.
- You will add following to your project.
.buckconfig
.expo/
.gitattributes
android/
index.ios.js
index.js
ios/
- Import inside Android Studio the android folder. Gradle will ad some files of its own.
- Run the project using
react-native run-android - You will see a lot of fonts not working. Solve it using
react-native link. It will addandroid/settings.gradleandandroid/src/main/java/<package-name>/MainApplication.java. These two files are important.
- Remove everything from RN project android folder(keep the 2 files mentioned above as backup). Copy Unity project contents into android folder
- Check MyReactActivity to check for app name in
mReactRootView.startReactApplication(mReactInstanceManager, "<app_name>", null);
- Using this link
- Run
react-native link. Addsettings.gradleandMainApplication.javaat the position needed by this command