Plain Unity Plain React Native - Shaunakdas/doc_genius_native GitHub Wiki
npm install node
npm install watchman
npm install -g react-native-cli
- Stop before Creating a new application
- Prerequisites
- Peer Dependency Issue: You must install peer dependencies yourself
- .gitignore for git commits
- Add reference to Android Activity using following methods
EventDelegate.Add (gameObject.GetComponent<UIButton> ().onClick, StartPackage );
void StartPackage(){
AndroidJavaClass activityClass;
AndroidJavaObject activity, packageManager;
AndroidJavaObject launch;
activityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
activity = activityClass.GetStatic<AndroidJavaObject>("currentActivity");
activity.Call("Call");
}
- Add package name
- Add keystore and key. Store these items.
- [Importing into Android Studio]
- Change build.gradle script with
{
classpath 'com.android.tools.build:gradle:2.3.0'
}
- Git Commit
- .gitignore for android folder
- Create
androidfolder inside RNApp folder. Copy contents of unity exported folder into android folder inside RNApp folder.
- Start off this with this link. Dont do Gradle sync yet!
- Add following to allprojects block
allprojects {
repositories {
...
maven {
// All of React Native (JS, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
mavenCentral()
}
}
- Add following to dependencies block (based on on your react native version)
compile "com.facebook.react:react-native:0.50.4" // From node_modules.
- Do Gradle sync now.
Configuring permissions in Android Manifest file: Link
Code Integrations: Link
####Configure React Native Dev Overlay in Root Activity : Steps
- Add value to a variable just inside class
public int OVERLAY_PERMISSION_REQ_CODE =1;
Test Integration: Link
- Change permission on gradlew
chmod 755 android/gradlew
- Start running with this command
react-native run-android --appFolder /Users/shaunakdas2020/../UnityIntegrateApp/android