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
62802e4c
Commit
62802e4c
authored
Mar 18, 2018
by
aaron hendrick
Committed by
Mehdi Achour
Mar 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(getBatteryLevel): change method to respect tvos targets (#363)
parent
805fe1d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
RNDeviceInfo.m
RNDeviceInfo/RNDeviceInfo.m
+4
-0
No files found.
RNDeviceInfo/RNDeviceInfo.m
View file @
62802e4c
...
...
@@ -306,7 +306,11 @@ RCT_EXPORT_METHOD(isPinOrFingerprintSet:(RCTResponseSenderBlock)callback)
RCT_EXPORT_METHOD
(
getBatteryLevel
:
(
RCTPromiseResolveBlock
)
resolve
rejecter
:
(
RCTPromiseRejectBlock
)
reject
)
{
#if TARGET_OS_TV
float
batteryLevel
=
1
.
0
;
#else
float
batteryLevel
=
[
UIDevice
currentDevice
].
batteryLevel
;
#endif
resolve
(
@
(
batteryLevel
));
}
...
...
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