Commit bab01536 authored by Mikael Finstad's avatar Mikael Finstad Committed by GitHub

Fix instructions for android

RN moved the getPackages method from MainActivity to MainApplication in 0.29
parent 12fbdb26
......@@ -52,9 +52,34 @@ Run your project (Cmd+R)
Run `react-native link react-native-device-info` in your project root.
* register module (in MainActivity.java)
* register module
On React Native 0.18+:
On React Native 0.29+:
in MainApplication.java:
```java
import com.learnium.RNDeviceInfo.RNDeviceInfo; // <--- import
public class MainApplication extends Application implements ReactApplication {
......
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new RNDeviceInfo(), // <---- add here
new MainReactPackage()
);
}
......
}
```
On React Native 0.18-0.28:
in MainActivity.java:
```java
import com.learnium.RNDeviceInfo.RNDeviceInfo; // <--- import
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment