diff --git a/packages/share_plus/share_plus/CHANGELOG.md b/packages/share_plus/share_plus/CHANGELOG.md index ff4284e43c..abd0cd34eb 100644 --- a/packages/share_plus/share_plus/CHANGELOG.md +++ b/packages/share_plus/share_plus/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.4 + +- iOS: Fixed sharing malformed URLs + ## 3.0.3 - Improve documentation for `shareFiles` method diff --git a/packages/share_plus/share_plus/ios/Classes/FLTSharePlusPlugin.m b/packages/share_plus/share_plus/ios/Classes/FLTSharePlusPlugin.m index a45dce97ec..e488c01c10 100644 --- a/packages/share_plus/share_plus/ios/Classes/FLTSharePlusPlugin.m +++ b/packages/share_plus/share_plus/ios/Classes/FLTSharePlusPlugin.m @@ -210,9 +210,10 @@ + (void)shareText:(NSString *)shareText subject:(NSString *)subject withController:(UIViewController *)controller atSource:(CGRect)origin { - NSObject *data = [shareText hasPrefix:@"https://"] - ? [[NSURL alloc] initWithString:shareText] - : [[SharePlusData alloc] initWithSubject:subject text:shareText]; + NSObject *data = [[NSURL alloc] initWithString:shareText]; + if (data == nil) { + data = [[SharePlusData alloc] initWithSubject:subject text:shareText]; + } [self share:@[ data ] withController:controller atSource:origin]; } diff --git a/packages/share_plus/share_plus/pubspec.yaml b/packages/share_plus/share_plus/pubspec.yaml index d0e1e883d5..7bf9381d2b 100644 --- a/packages/share_plus/share_plus/pubspec.yaml +++ b/packages/share_plus/share_plus/pubspec.yaml @@ -1,6 +1,6 @@ name: share_plus description: Flutter plugin for sharing content via the platform share UI, using the ACTION_SEND intent on Android and UIActivityViewController on iOS. -version: 3.0.3 +version: 3.0.4 homepage: https://plus.fluttercommunity.dev/ repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/