Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Julian Steenbakker
2022-02-23 13:24:15 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f1491923c7ea71a923b006b4912b15073bd11791
f1491923
1 parent
c3429855
bug: add camera check for ios
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
ios/Classes/SwiftMobileScannerPlugin.swift
ios/Classes/SwiftMobileScannerPlugin.swift
View file @
f149192
...
...
@@ -180,6 +180,13 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHan
device
=
AVCaptureDevice
.
devices
(
for
:
.
video
)
.
filter
({
$0
.
position
==
position
})
.
first
}
if
(
device
==
nil
)
{
result
(
FlutterError
(
code
:
"MobileScanner"
,
message
:
"No camera found or failed to open camera!"
,
details
:
nil
))
return
}
// Enable the torch if parameter is set and torch is available
if
(
device
.
hasTorch
&&
device
.
isTorchAvailable
)
{
do
{
...
...
Please
register
or
login
to post a comment