This commit is contained in:
Rody Davis 2018-08-16 10:39:54 -04:00
commit b8f6dfb6df

View File

@ -32,18 +32,4 @@ public class SwiftFlutterSmsPlugin: NSObject, FlutterPlugin, UINavigationControl
UIApplication.shared.keyWindow?.rootViewController?.dismiss(animated: true, completion: nil)
message = "Sent!"
}
private func saveToFile(image: UIImage) -> Any {
guard let data = UIImageJPEGRepresentation(image, 1.0) else {
return FlutterError(code: "image_encoding_error", message: "Could not read image", details: nil)
}
let tempDir = NSTemporaryDirectory()
let imageName = "image_picker_\(ProcessInfo().globallyUniqueString).jpg"
let filePath = tempDir.appending(imageName)
if FileManager.default.createFile(atPath: filePath, contents: data, attributes: nil) {
return filePath
} else {
return FlutterError(code: "image_save_failed", message: "Could not save image to disk", details: nil)
}
}
}