Skip to content

Commit

Permalink
Merge pull request OpenFlutter#67 from jordanjanaq/master
Browse files Browse the repository at this point in the history
Fix dialog shared facebook and image jpge representation
  • Loading branch information
lizhuoyuan authored Dec 29, 2021
2 parents b69026a + 35368f2 commit fdebb9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Binary file added .DS_Store
Binary file not shown.
9 changes: 6 additions & 3 deletions ios/Classes/SwiftFlutterShareMePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ public class SwiftFlutterShareMePlugin: NSObject, FlutterPlugin, SharingDelegate
result("File format not supported Please check the file.")
return;
}
urlData=UIImageJPEGRepresentation(image!, 1.0)!
//urlData=UIImageJPEGRepresentation(image!, 1.0)!
urlData = image!.jpegData(compressionQuality: 1.0)!
filePath=URL(fileURLWithPath:NSHomeDirectory()).appendingPathComponent("Documents/whatsAppTmp.wai")
}else{
filePath=URL(fileURLWithPath:NSTemporaryDirectory()).appendingPathComponent("video.m4v")
Expand Down Expand Up @@ -186,12 +187,14 @@ public class SwiftFlutterShareMePlugin: NSObject, FlutterPlugin, SharingDelegate

func sharefacebook(message:Dictionary<String,Any>, result: @escaping FlutterResult) {
let viewController = UIApplication.shared.delegate?.window??.rootViewController
let shareDialog=ShareDialog()
//let shareDialog = ShareDialog()
let shareContent = ShareLinkContent()
shareContent.contentURL = URL.init(string: message["url"] as! String)!
shareContent.quote = message["msg"] as? String

let shareDialog = ShareDialog(viewController: viewController, content: shareContent, delegate: self)
shareDialog.mode = .automatic
ShareDialog(fromViewController: viewController, content: shareContent, delegate: self).show()
shareDialog.show()
result("Sucess")

}
Expand Down

0 comments on commit fdebb9b

Please sign in to comment.