mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-13 09:25:36 +08:00
Adding RNPM/Android doc
This commit is contained in:
23
README.md
23
README.md
@@ -282,7 +282,7 @@ After installing the plugin and syncing your Android Studio project with Gradle,
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Plugin Configuration (Android - React Native v0.18.0+)
|
||||
|
||||
*NOTE: These instructions are specific to apps that are using React Native v0.18.0+. If you are using v0.15.0-v0.17.0, then refer to the previous section.*
|
||||
@@ -324,6 +324,27 @@ After installing the plugin and syncing your Android Studio project with Gradle,
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
3. If you used RNPM to install/link the CodePush plugin, there are a two additional changes you'll need to make due to the fact thsat RNPM makes some assupmtions about the CodePush plugin that aren't currently true. Otherwise, skip to step #3:
|
||||
|
||||
```java
|
||||
...
|
||||
// 1. Remove the following import statement
|
||||
import com.microsoft.codepush.react.CodePushReactPackage;
|
||||
...
|
||||
public class MainActivity extends ReactActivity {
|
||||
...
|
||||
@Override
|
||||
protected List<ReactPackage> getPackages() {
|
||||
return Arrays.<ReactPackage>asList(
|
||||
...
|
||||
new CodePushReactPackage() // 2. Remove this line
|
||||
...
|
||||
);
|
||||
}
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
2. Ensure that the `android.defaultConfig.versionName` property in your `android/app/build.gradle` file is set to a semver compliant value. Note that if the value provided is missing a patch version, the CodePush server will assume it is `0`, i.e. `1.0` will be treated as `1.0.0`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user