From 71aee8e0f42b2c3a120b95a07b8c24e69b28bf5e Mon Sep 17 00:00:00 2001 From: Jordan Rojas Date: Tue, 19 Oct 2021 18:27:16 -0500 Subject: [PATCH 1/5] fix share facebook ShareDialog --- .DS_Store | Bin 0 -> 6148 bytes ios/Classes/SwiftFlutterShareMePlugin.swift | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7083c2cdeb21cc56fc88307e911539cde5ad40e2 GIT binary patch literal 6148 zcmeH~Jr2S!425mVfW*>~F$)La1`&c2Z~+7?NR>Ju_8gt(pM}DVD)cPbU+mOs`-Y|# z5#2v;JCR;QR&b+iElf<2cXF3e9=FGJxQydqCAUS=3h-Vg`?*a}0V+TRr~nn90y9z| z5AxM|M$g1Yp#oH39tzm^p}>tb*@FJ*K=2U&T%zoTwa*e@u>x3=Er<$CqZN!+^)bZi z-VT<$t|nVB+C_8t(7dzS6a&*}7cEF&S{)2jfC@|$=pyg!{6E6K&Hs}Yrc{6m{Fwr} zJe&@Dyi}g8AFpTib5?EL;GkcQ@b(jc#E#+(+ztE17GO=bASy8a2)GOkRN$uyya4uL B5qJOq literal 0 HcmV?d00001 diff --git a/ios/Classes/SwiftFlutterShareMePlugin.swift b/ios/Classes/SwiftFlutterShareMePlugin.swift index 725c938..dba269f 100644 --- a/ios/Classes/SwiftFlutterShareMePlugin.swift +++ b/ios/Classes/SwiftFlutterShareMePlugin.swift @@ -186,12 +186,12 @@ public class SwiftFlutterShareMePlugin: NSObject, FlutterPlugin, SharingDelegate func sharefacebook(message:Dictionary, 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 shareDialog.mode = .automatic - ShareDialog(fromViewController: viewController, content: shareContent, delegate: self).show() + ShareDialog(viewController: viewController, content: shareContent, delegate: self).show() result("Sucess") } From 7493bffedc7bc7aee279274b4f86dbfc626f52c1 Mon Sep 17 00:00:00 2001 From: Jordan Rojas Date: Tue, 19 Oct 2021 18:47:57 -0500 Subject: [PATCH 2/5] fix dialog --- ios/Classes/SwiftFlutterShareMePlugin.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ios/Classes/SwiftFlutterShareMePlugin.swift b/ios/Classes/SwiftFlutterShareMePlugin.swift index dba269f..e32309a 100644 --- a/ios/Classes/SwiftFlutterShareMePlugin.swift +++ b/ios/Classes/SwiftFlutterShareMePlugin.swift @@ -186,12 +186,13 @@ public class SwiftFlutterShareMePlugin: NSObject, FlutterPlugin, SharingDelegate func sharefacebook(message:Dictionary, 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).show() shareDialog.mode = .automatic - ShareDialog(viewController: viewController, content: shareContent, delegate: self).show() result("Sucess") } From 9a7afa1c737eeee66f8921f9d9521f981d4e4a0b Mon Sep 17 00:00:00 2001 From: Jordan Rojas Date: Tue, 19 Oct 2021 18:50:08 -0500 Subject: [PATCH 3/5] fix dialog --- ios/Classes/SwiftFlutterShareMePlugin.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ios/Classes/SwiftFlutterShareMePlugin.swift b/ios/Classes/SwiftFlutterShareMePlugin.swift index e32309a..9074004 100644 --- a/ios/Classes/SwiftFlutterShareMePlugin.swift +++ b/ios/Classes/SwiftFlutterShareMePlugin.swift @@ -191,8 +191,9 @@ public class SwiftFlutterShareMePlugin: NSObject, FlutterPlugin, SharingDelegate shareContent.contentURL = URL.init(string: message["url"] as! String)! shareContent.quote = message["msg"] as? String - let shareDialog = ShareDialog(viewController: viewController, content: shareContent, delegate: self).show() + let shareDialog = ShareDialog(viewController: viewController, content: shareContent, delegate: self) shareDialog.mode = .automatic + shareDialog.show() result("Sucess") } From 1aa0c7e675f71287140d77e171335332fef89324 Mon Sep 17 00:00:00 2001 From: Jordan Rojas Date: Tue, 19 Oct 2021 18:58:21 -0500 Subject: [PATCH 4/5] fix 'UIImageJPEGRepresentation' has been replaced by instance method 'UIImage.jpegData(compressionQuality:)' --- ios/Classes/SwiftFlutterShareMePlugin.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ios/Classes/SwiftFlutterShareMePlugin.swift b/ios/Classes/SwiftFlutterShareMePlugin.swift index 9074004..eb26abf 100644 --- a/ios/Classes/SwiftFlutterShareMePlugin.swift +++ b/ios/Classes/SwiftFlutterShareMePlugin.swift @@ -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") From 35368f25fd5ff913ca3c5ad32210b1b1335672d4 Mon Sep 17 00:00:00 2001 From: Jordan Rojas Date: Tue, 19 Oct 2021 19:05:46 -0500 Subject: [PATCH 5/5] fix image for share --- ios/Classes/SwiftFlutterShareMePlugin.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Classes/SwiftFlutterShareMePlugin.swift b/ios/Classes/SwiftFlutterShareMePlugin.swift index eb26abf..e748eda 100644 --- a/ios/Classes/SwiftFlutterShareMePlugin.swift +++ b/ios/Classes/SwiftFlutterShareMePlugin.swift @@ -114,7 +114,7 @@ public class SwiftFlutterShareMePlugin: NSObject, FlutterPlugin, SharingDelegate return; } //urlData=UIImageJPEGRepresentation(image!, 1.0)! - urlData = image.jpegData(compressionQuality: 1.0)! + urlData = image!.jpegData(compressionQuality: 1.0)! filePath=URL(fileURLWithPath:NSHomeDirectory()).appendingPathComponent("Documents/whatsAppTmp.wai") }else{ filePath=URL(fileURLWithPath:NSTemporaryDirectory()).appendingPathComponent("video.m4v")