File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 11#import < Cordova/CDVPlugin.h>
22#import < SafariServices/SafariServices.h>
33
4+ @protocol ActivityItemProvider
5+
6+ - (NSArray <UIActivity *> *)safariViewController : (SFSafariViewController *)controller
7+ activityItemsForURL : (NSURL *)URL
8+ title : (nullable NSString *)title ;
9+
10+ @end
11+
412@interface SafariViewController : CDVPlugin <SFSafariViewControllerDelegate>
513
614@property (nonatomic , copy ) NSString * callbackId;
715@property (nonatomic ) bool animated;
16+ @property (nonatomic ) id <ActivityItemProvider> activityItemProvider;
817
918- (void ) isAvailable : (CDVInvokedUrlCommand*)command ;
1019- (void ) show : (CDVInvokedUrlCommand*)command ;
1120- (void ) hide : (CDVInvokedUrlCommand*)command ;
1221
13- @end
22+ @end
Original file line number Diff line number Diff line change @@ -143,4 +143,14 @@ - (void)safariViewController:(SFSafariViewController *)controller didCompleteIni
143143 }
144144}
145145
146+ - (NSArray <UIActivity *> *)safariViewController : (SFSafariViewController *)
147+ controller activityItemsForURL : (NSURL *)URL
148+ title : (nullable NSString *)title {
149+
150+ if (self.activityItemProvider )
151+ return [self .activityItemProvider safariViewController: controller activityItemsForURL: URL title: title];
152+ else
153+ return nil ;
154+ }
155+
146156@end
You can’t perform that action at this time.
0 commit comments