Updated README.md installation instructions (#56)

Updated the documentation to reflect the changes in React Native, as MainApplication is being used instead of MainActivity in the current version of React Native.
This commit is contained in:
Henrik 2017-09-17 19:35:55 +02:00 committed by Vojtech Novak
parent 2ccfdc1afc
commit 33e463d523
1 changed files with 6 additions and 5 deletions

View File

@ -45,25 +45,26 @@ include ':react-native-dialogs'
project(':react-native-dialogs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-dialogs/android') project(':react-native-dialogs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-dialogs/android')
``` ```
Next, you need to change the `MainActivity` of your app to register `ReactNativeDialogsPackage` : Next, you need to change the `MainApplication` of your app to register `ReactNativeDialogsPackage` :
```java ```java
import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage; // ... Other imports
import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage; // <-- Add this import.
//... //...
public class MainActivity extends ReactActivity { public class MainApplication extends ReactActivity {
//... //...
@Override @Override
protected List<ReactPackage> getPackages() { protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList( return Arrays.<ReactPackage>asList(
new MainReactPackage(), new MainReactPackage(),
new ReactNativeDialogsPackage() // add this manager new ReactNativeDialogsPackage() // <-- Add this package.
); );
} }
} }
``` ```
See [this changelog](https://github.com/aakashns/react-native-dialogs-example/commit/52cac27756963bcd2f4fdcd039e1a78028bb0abd) for reference. See [this changelog](https://github.com/aakashns/react-native-dialogs-example/commit/52cac27756963bcd2f4fdcd039e1a78028bb0abd) for reference(Earlier versions of React native used MainActivity instead of MainApplication).
Now you're finally ready to start using module in your React Native application. See [this changelog](https://github.com/aakashns/react-native-dialogs-example/commit/2d8e02c22275479d2fbbb89f99dcb846834bec9d) for an example that uses `DialogAndroid`. Now you're finally ready to start using module in your React Native application. See [this changelog](https://github.com/aakashns/react-native-dialogs-example/commit/2d8e02c22275479d2fbbb89f99dcb846834bec9d) for an example that uses `DialogAndroid`.