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
382cd487
Commit
382cd487
authored
Mar 07, 2017
by
Kacyn Fujii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change method name and update readme
parent
ffd4e0b5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
README.md
README.md
+2
-0
RNDeviceInfo.m
RNDeviceInfo/RNDeviceInfo.m
+2
-2
RNDeviceModule.java
...c/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java
+2
-2
deviceinfo.js
deviceinfo.js
+2
-2
No files found.
README.md
View file @
382cd487
...
@@ -198,4 +198,6 @@ console.log("App Instance ID", DeviceInfo.getInstanceID()); // ANDROID ONLY - se
...
@@ -198,4 +198,6 @@ console.log("App Instance ID", DeviceInfo.getInstanceID()); // ANDROID ONLY - se
console.log("App is running in emulator", DeviceInfo.isEmulator()); // if app is running in emulator return true
console.log("App is running in emulator", DeviceInfo.isEmulator()); // if app is running in emulator return true
console.log("App is running on a tablet", DeviceInfo.isTablet()); // if app is running on a tablet return true
console.log("App is running on a tablet", DeviceInfo.isTablet()); // if app is running on a tablet return true
console.log("PIN or fingerprint configured on device", DeviceInfo.isPinOrFingerprintSet()); // if PIN or fingerprint is configured
``
`
``
`
RNDeviceInfo/RNDeviceInfo.m
View file @
382cd487
...
@@ -163,7 +163,7 @@ RCT_EXPORT_MODULE()
...
@@ -163,7 +163,7 @@ RCT_EXPORT_MODULE()
return
[[
UIDevice
currentDevice
]
userInterfaceIdiom
]
==
UIUserInterfaceIdiomPad
;
return
[[
UIDevice
currentDevice
]
userInterfaceIdiom
]
==
UIUserInterfaceIdiomPad
;
}
}
-
(
bool
)
is
SecurityEnabled
-
(
bool
)
is
PinOrFingerprintSet
{
{
LAContext
*
context
=
[[
LAContext
alloc
]
init
];
LAContext
*
context
=
[[
LAContext
alloc
]
init
];
return
([
context
canEvaluatePolicy
:
LAPolicyDeviceOwnerAuthenticationWithBiometrics
error
:
nil
]);
return
([
context
canEvaluatePolicy
:
LAPolicyDeviceOwnerAuthenticationWithBiometrics
error
:
nil
]);
...
@@ -193,7 +193,7 @@ RCT_EXPORT_MODULE()
...
@@ -193,7 +193,7 @@ RCT_EXPORT_MODULE()
@"timezone"
:
self
.
timezone
,
@"timezone"
:
self
.
timezone
,
@"isEmulator"
:
@
(
self
.
isEmulator
),
@"isEmulator"
:
@
(
self
.
isEmulator
),
@"isTablet"
:
@
(
self
.
isTablet
),
@"isTablet"
:
@
(
self
.
isTablet
),
@"is
SecurityEnabled"
:
@
(
self
.
isSecurityEnabled
),
@"is
PinOrFingerprintSet"
:
@
(
self
.
isPinOrFingerprintSet
),
};
};
}
}
...
...
android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java
View file @
382cd487
...
@@ -71,7 +71,7 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
...
@@ -71,7 +71,7 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
return
layout
==
Configuration
.
SCREENLAYOUT_SIZE_LARGE
||
layout
==
Configuration
.
SCREENLAYOUT_SIZE_XLARGE
;
return
layout
==
Configuration
.
SCREENLAYOUT_SIZE_LARGE
||
layout
==
Configuration
.
SCREENLAYOUT_SIZE_XLARGE
;
}
}
private
Boolean
is
SecurityEnabled
()
{
private
Boolean
is
PinOrFingerprintSet
()
{
KeyguardManager
keyguardManager
=
(
KeyguardManager
)
this
.
reactContext
.
getSystemService
(
Context
.
KEYGUARD_SERVICE
);
//api 16+
KeyguardManager
keyguardManager
=
(
KeyguardManager
)
this
.
reactContext
.
getSystemService
(
Context
.
KEYGUARD_SERVICE
);
//api 16+
return
keyguardManager
.
isKeyguardSecure
();
return
keyguardManager
.
isKeyguardSecure
();
}
}
...
@@ -120,7 +120,7 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
...
@@ -120,7 +120,7 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
constants
.
put
(
"timezone"
,
TimeZone
.
getDefault
().
getID
());
constants
.
put
(
"timezone"
,
TimeZone
.
getDefault
().
getID
());
constants
.
put
(
"isEmulator"
,
this
.
isEmulator
());
constants
.
put
(
"isEmulator"
,
this
.
isEmulator
());
constants
.
put
(
"isTablet"
,
this
.
isTablet
());
constants
.
put
(
"isTablet"
,
this
.
isTablet
());
constants
.
put
(
"is
SecurityEnabled"
,
this
.
isSecurityEnabled
());
constants
.
put
(
"is
PinOrFingerprintSet"
,
this
.
isPinOrFingerprintSet
());
return
constants
;
return
constants
;
}
}
}
}
deviceinfo.js
View file @
382cd487
...
@@ -62,7 +62,7 @@ module.exports = {
...
@@ -62,7 +62,7 @@ module.exports = {
isTablet
:
function
()
{
isTablet
:
function
()
{
return
RNDeviceInfo
.
isTablet
;
return
RNDeviceInfo
.
isTablet
;
},
},
is
SecurityEnabled
:
function
()
{
is
PinOrFingerprintSet
:
function
()
{
return
RNDeviceInfo
.
is
SecurityEnabled
;
return
RNDeviceInfo
.
is
PinOrFingerprintSet
;
},
},
};
};
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