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
ebacfb0c
Commit
ebacfb0c
authored
Aug 18, 2016
by
Gant Laborde
Committed by
GitHub
Aug 18, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #81 from zxcpoiu/add-brand
add getBrand() on both android and ios
parents
2ebefdda
cc8b14e1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
0 deletions
+7
-0
README.md
README.md
+2
-0
RNDeviceInfo.m
RNDeviceInfo/RNDeviceInfo.m
+1
-0
RNDeviceModule.java
...c/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java
+1
-0
deviceinfo.js
deviceinfo.js
+3
-0
No files found.
README.md
View file @
ebacfb0c
...
@@ -131,6 +131,8 @@ console.log("Device Unique ID", DeviceInfo.getUniqueID()); // e.g. FCDBD8EF-62F
...
@@ -131,6 +131,8 @@ console.log("Device Unique ID", DeviceInfo.getUniqueID()); // e.g. FCDBD8EF-62F
console
.
log
(
"Device Manufacturer"
,
DeviceInfo
.
getManufacturer
());
// e.g. Apple
console
.
log
(
"Device Manufacturer"
,
DeviceInfo
.
getManufacturer
());
// e.g. Apple
console
.
log
(
"Device Brand"
,
DeviceInfo
.
getBrand
());
// e.g. Apple / htc / Xiaomi
console
.
log
(
"Device Model"
,
DeviceInfo
.
getModel
());
// e.g. iPhone 6
console
.
log
(
"Device Model"
,
DeviceInfo
.
getModel
());
// e.g. iPhone 6
console
.
log
(
"Device ID"
,
DeviceInfo
.
getDeviceId
());
// e.g. iPhone7,2 / or the board on Android e.g. goldfish
console
.
log
(
"Device ID"
,
DeviceInfo
.
getDeviceId
());
// e.g. iPhone7,2 / or the board on Android e.g. goldfish
...
...
RNDeviceInfo/RNDeviceInfo.m
View file @
ebacfb0c
...
@@ -159,6 +159,7 @@ RCT_EXPORT_MODULE()
...
@@ -159,6 +159,7 @@ RCT_EXPORT_MODULE()
@"systemName"
:
currentDevice
.
systemName
,
@"systemName"
:
currentDevice
.
systemName
,
@"systemVersion"
:
currentDevice
.
systemVersion
,
@"systemVersion"
:
currentDevice
.
systemVersion
,
@"model"
:
self
.
deviceName
,
@"model"
:
self
.
deviceName
,
@"brand"
:
@"Apple"
,
@"deviceId"
:
self
.
deviceId
,
@"deviceId"
:
self
.
deviceId
,
@"deviceName"
:
currentDevice
.
name
,
@"deviceName"
:
currentDevice
.
name
,
@"deviceLocale"
:
self
.
deviceLocale
,
@"deviceLocale"
:
self
.
deviceLocale
,
...
...
android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java
View file @
ebacfb0c
...
@@ -85,6 +85,7 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
...
@@ -85,6 +85,7 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
constants
.
put
(
"systemName"
,
"Android"
);
constants
.
put
(
"systemName"
,
"Android"
);
constants
.
put
(
"systemVersion"
,
Build
.
VERSION
.
RELEASE
);
constants
.
put
(
"systemVersion"
,
Build
.
VERSION
.
RELEASE
);
constants
.
put
(
"model"
,
Build
.
MODEL
);
constants
.
put
(
"model"
,
Build
.
MODEL
);
constants
.
put
(
"brand"
,
Build
.
BRAND
);
constants
.
put
(
"deviceId"
,
Build
.
BOARD
);
constants
.
put
(
"deviceId"
,
Build
.
BOARD
);
constants
.
put
(
"deviceLocale"
,
this
.
getCurrentLanguage
());
constants
.
put
(
"deviceLocale"
,
this
.
getCurrentLanguage
());
constants
.
put
(
"deviceCountry"
,
this
.
getCurrentCountry
());
constants
.
put
(
"deviceCountry"
,
this
.
getCurrentCountry
());
...
...
deviceinfo.js
View file @
ebacfb0c
...
@@ -20,6 +20,9 @@ module.exports = {
...
@@ -20,6 +20,9 @@ module.exports = {
getModel
:
function
()
{
getModel
:
function
()
{
return
RNDeviceInfo
.
model
;
return
RNDeviceInfo
.
model
;
},
},
getBrand
:
function
()
{
return
RNDeviceInfo
.
brand
;
},
getSystemName
:
function
()
{
getSystemName
:
function
()
{
return
RNDeviceInfo
.
systemName
;
return
RNDeviceInfo
.
systemName
;
},
},
...
...
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