Skip to content

Commit

Permalink
Updating methods for alpha.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikeith committed Nov 25, 2020
1 parent f3dd447 commit 94e8434
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions camera/ios/Plugin/CameraPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class CameraPlugin: CAPPlugin {

private var imageCounter = 0

@objc func checkPermissions(_ call: CAPPluginCall) {
@objc public override func checkPermissions(_ call: CAPPluginCall) {
var result: [String: Any] = [:]
for permission in CameraPermissionType.allCases {
let state: String
Expand All @@ -31,7 +31,7 @@ public class CameraPlugin: CAPPlugin {
call.resolve(result)
}

@objc func requestPermissions(_ call: CAPPluginCall) {
@objc public override func requestPermissions(_ call: CAPPluginCall) {
// get the list of desired types, if passed
let typeList = call.getArray("types", String.self)?.compactMap({ (type) -> CameraPermissionType? in
return CameraPermissionType(rawValue: type)
Expand Down Expand Up @@ -177,7 +177,7 @@ extension CameraPlugin: UIImagePickerControllerDelegate, UINavigationControllerD
])
} else if settings.resultType == CameraResultType.uri {
guard let path = try? saveTemporaryImage(jpeg),
let webPath = CAPFileManager.getPortablePath(host: bridge?.getLocalUrl() ?? "", uri: URL(string: path)) else {
let webPath = CAPFileManager.getPortablePath(host: bridge?.config.localURL.path ?? "", uri: URL(string: path)) else {
call?.reject("Unable to get portable path to file")
return
}
Expand Down Expand Up @@ -214,7 +214,7 @@ private extension CameraPlugin {

func showCamera() {
// check if we have a camera
if (bridge?.isSimulator() ?? false) || !UIImagePickerController.isSourceTypeAvailable(UIImagePickerController.SourceType.camera) {
if (bridge?.isSimEnvironment ?? false) || !UIImagePickerController.isSourceTypeAvailable(UIImagePickerController.SourceType.camera) {
bridge?.modulePrint(self, "Camera not available in simulator")
bridge?.alert("Camera Error", "Camera not available in Simulator")
call?.reject("Camera not available while running in Simulator")
Expand Down

0 comments on commit 94e8434

Please sign in to comment.