Merge branch 'master' of https://github.com/AppleEducate/flutter_sms
This commit is contained in:
commit
b8f6dfb6df
@ -32,18 +32,4 @@ public class SwiftFlutterSmsPlugin: NSObject, FlutterPlugin, UINavigationControl
|
|||||||
UIApplication.shared.keyWindow?.rootViewController?.dismiss(animated: true, completion: nil)
|
UIApplication.shared.keyWindow?.rootViewController?.dismiss(animated: true, completion: nil)
|
||||||
message = "Sent!"
|
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user