Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
react-native-device-info
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
放牛的园子
react-native-device-info
Commits
bab01536
Commit
bab01536
authored
Jul 20, 2016
by
Mikael Finstad
Committed by
GitHub
Jul 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix instructions for android
RN moved the getPackages method from MainActivity to MainApplication in 0.29
parent
12fbdb26
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
+27
-2
README.md
README.md
+27
-2
No files found.
README.md
View file @
bab01536
...
@@ -52,9 +52,34 @@ Run your project (Cmd+R)
...
@@ -52,9 +52,34 @@ Run your project (Cmd+R)
Run
`react-native link react-native-device-info`
in your project root.
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
```
java
import
com.learnium.RNDeviceInfo.RNDeviceInfo
;
// <--- import
import
com.learnium.RNDeviceInfo.RNDeviceInfo
;
// <--- import
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment