Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions docs/setup-android.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## Android Setup

* [Plugin Installation and Configuration for React Native 0.76 version and above](#plugin-installation-and-configuration-for-react-native-060-version-and-above-android)
* [Code Signing setup](#code-signing-setup)
- [Android Setup](#android-setup)
- [Plugin Installation and Configuration for React Native 0.76 version and above (Android)](#plugin-installation-and-configuration-for-react-native-076-version-and-above-android)
- [Expo Integration](#expo-integration)

In order to integrate CodePush into your Android project, please perform the following steps:

Expand All @@ -18,7 +19,7 @@ In order to integrate CodePush into your Android project, please perform the fol

2. Update the `MainApplication` file to use CodePush via the following changes:

For React Native 0.76 and above: update the `MainApplication.kt`
For React Native 0.76 to 0.81: update the `MainApplication.kt`

**Important! : PackageList must be instantiated only one in application lifetime.**

Expand All @@ -43,6 +44,31 @@ In order to integrate CodePush into your Android project, please perform the fol
}
};
}

For React Native 0.82 and above: update the `MainApplication.kt` as follows:

```kotlin
...
// 1. Import the plugin class.
import com.microsoft.codepush.react.CodePush

class MainApplication : Application(), ReactApplication {

override val reactHost: ReactHost by lazy {
getDefaultReactHost(
context = applicationContext,
packageList =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
},
// 2. RN 0.82+ uses ReactHost config instead of overriding getJSBundleFile().
// Set jsBundleFilePath to CodePush so CodePush resolves the JS bundle path
// at startup (OTA update if available, fallback to bundled JS otherwise).
jsBundleFilePath = CodePush.getJSBundleFile(),
)
}
}
```


Expand Down