An open API service indexing awesome lists of open source software.

https://github.com/ganny26/react-native-android

Integrating react native to existing android application
https://github.com/ganny26/react-native-android

android react-native

Last synced: 2 months ago
JSON representation

Integrating react native to existing android application

Awesome Lists containing this project

README

          

## React Native Android Setup on Existing App

This app demonstrates how to integrate a single activity with react native view

### How to start

* Open `rnapp/index.js`
* Do required changes in `index.js` file

### How to debug
* Connect physical device and do `yarn start` from rnapp folder
* To debug go to url `http://localhost:8081/debugger-ui/`

* To view metro bundled js file `http://localhost:8081/index.delta?platform=android&dev=true`

* Inorder to reload js files on your activity
type `adb shell input keyevent 82` it will enable debug menu to reload

* If you are on emulator press `Command ⌘ + M`

# Codepush Setup

1. Generate JSK file

```bash
keytool -genkey -alias -keypass -keyalg RSA -keystore codepushandroid.jks
```

2. Login to appcenter cli

```bash
npm install -g appcenter-cli
appcenter login
appcenter apps list
appcenter apps set-current
```

3. Create token

```bash
appcenter codepush deployment add -a Staging
appcenter codepush deployment list --displayKeys
```

4. To upload `index.js` bundle

```bash
code-push release-react android

(or)

appcenter codepush release-react -a -d Staging

```

### How to release

* `yarn build` will generate bundle on `src/main/assets/index.android.bundle`
* Then build signed APK

## Release OTA using Azure

https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli

### Further references

1. https://facebook.github.io/react-native/docs/integration-with-existing-apps
2. https://medium.com/mindorks/react-native-integration-with-existing-app-f2757c2e672d
3. https://codeburst.io/integrating-react-native-into-an-existing-app-android-c27bb1b81574