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
588470e5
Commit
588470e5
authored
Mar 08, 2017
by
Kacyn Fujii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fallback for ios 8
parent
382cd487
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
README.md
README.md
+2
-1
RNDeviceInfo.m
RNDeviceInfo/RNDeviceInfo.m
+8
-1
No files found.
README.md
View file @
588470e5
...
@@ -199,5 +199,6 @@ console.log("App is running in emulator", DeviceInfo.isEmulator()); // if app is
...
@@ -199,5 +199,6 @@ console.log("App is running in emulator", DeviceInfo.isEmulator()); // if app is
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
console.log("PIN or fingerprint configured on device", DeviceInfo.isPinOrFingerprintSet()); // if PIN or fingerprint is configured.
// For iOS 8.0 and below, this will only return true if Touch ID is enabled
``
`
``
`
RNDeviceInfo/RNDeviceInfo.m
View file @
588470e5
...
@@ -166,7 +166,14 @@ RCT_EXPORT_MODULE()
...
@@ -166,7 +166,14 @@ RCT_EXPORT_MODULE()
-
(
bool
)
isPinOrFingerprintSet
-
(
bool
)
isPinOrFingerprintSet
{
{
LAContext
*
context
=
[[
LAContext
alloc
]
init
];
LAContext
*
context
=
[[
LAContext
alloc
]
init
];
return
([
context
canEvaluatePolicy
:
LAPolicyDeviceOwnerAuthenticationWithBiometrics
error
:
nil
]);
// Fallback to LAPolicyDeviceOwnerAuthenticationWithBiometrics if iOS version <9.0
if
([[
NSProcessInfo
processInfo
]
isOperatingSystemAtLeastVersion
:(
NSOperatingSystemVersion
){
9
,
0
,
0
}])
{
return
([
context
canEvaluatePolicy
:
LAPolicyDeviceOwnerAuthentication
error
:
nil
]);
}
else
{
return
([
context
canEvaluatePolicy
:
LAPolicyDeviceOwnerAuthenticationWithBiometrics
error
:
nil
]);
}
}
}
-
(
NSDictionary
*
)
constantsToExport
-
(
NSDictionary
*
)
constantsToExport
...
...
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