Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit f001090

Browse files
mduonggapspt
andauthored
[share] Show the share text in the iOS share preview panel (#2)
Co-authored-by: Jorge Galvão <[email protected]>
1 parent 75542c9 commit f001090

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ Théo Champion <[email protected]>
5858
Kazuki Yamaguchi <[email protected]>
5959
Eitan Schwartz <[email protected]>
6060
Chris Rutkowski <[email protected]>
61+
Jorge Galvão <[email protected]>

packages/share/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.5
2+
3+
* Show the share text in the iOS share preview panel.
4+
15
## 0.6.4+3
26

37
* Post-v2 Android embedding cleanup.

packages/share/ios/Classes/FLTSharePlugin.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
#import "FLTSharePlugin.h"
6+
#import "LinkPresentation/LPLinkMetadata.h"
67

78
static NSString *const PLATFORM_CHANNEL = @"plugins.flutter.io/share";
89

@@ -47,6 +48,14 @@ - (NSString *)activityViewController:(UIActivityViewController *)activityViewCon
4748
return [_subject isKindOfClass:NSNull.class] ? @"" : _subject;
4849
}
4950

51+
- (LPLinkMetadata *)activityViewControllerLinkMetadata:
52+
(UIActivityViewController *)activityViewController
53+
API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0)) {
54+
LPLinkMetadata *metadata = [[LPLinkMetadata alloc] init];
55+
metadata.title = _text;
56+
return metadata;
57+
}
58+
5059
@end
5160

5261
@implementation FLTSharePlugin

packages/share/ios/share.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Downloaded by pub (not CocoaPods).
1717
s.source_files = 'Classes/**/*'
1818
s.public_header_files = 'Classes/**/*.h'
1919
s.dependency 'Flutter'
20+
s.ios.framework = 'LinkPresentation'
2021

2122
s.platform = :ios, '8.0'
2223
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }

packages/share/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ homepage: https://github.com/flutter/plugins/tree/master/packages/share
55
# 0.6.y+z is compatible with 1.0.0, if you land a breaking change bump
66
# the version to 2.0.0.
77
# See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0
8-
version: 0.6.4+3
8+
version: 0.6.5
99

1010
flutter:
1111
plugin:

0 commit comments

Comments
 (0)