From 0f0b57880fe5b2565cc247a2e0c0b7611330b5d1 Mon Sep 17 00:00:00 2001 From: Andreas Amsenius Date: Mon, 30 Nov 2015 06:18:55 -0800 Subject: [PATCH] ActionSheetIOS sharing exclude activity types Summary: Closes https://github.com/facebook/react-native/pull/4427 Reviewed By: svcscm Differential Revision: D2702825 Pulled By: nicklockwood fb-gh-sync-id: f12e83332f2083cee2c04625b5113774c8a907e0 --- Examples/UIExplorer/ActionSheetIOSExample.js | 3 +++ Libraries/ActionSheetIOS/RCTActionSheetManager.m | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/Examples/UIExplorer/ActionSheetIOSExample.js b/Examples/UIExplorer/ActionSheetIOSExample.js index 548fe3bd1..1ef41c1ed 100644 --- a/Examples/UIExplorer/ActionSheetIOSExample.js +++ b/Examples/UIExplorer/ActionSheetIOSExample.js @@ -90,6 +90,9 @@ var ShareActionSheetExample = React.createClass({ url: 'https://code.facebook.com', message: 'message to go with the shared url', subject: 'a subject to go in the email heading', + excludedActivityTypes: [ + 'com.apple.UIKit.activity.PostToTwitter' + ] }, (error) => { console.error(error); diff --git a/Libraries/ActionSheetIOS/RCTActionSheetManager.m b/Libraries/ActionSheetIOS/RCTActionSheetManager.m index 1d4e93ba7..245493b0c 100644 --- a/Libraries/ActionSheetIOS/RCTActionSheetManager.m +++ b/Libraries/ActionSheetIOS/RCTActionSheetManager.m @@ -172,6 +172,11 @@ RCT_EXPORT_METHOD(showShareActionSheetWithOptions:(NSDictionary *)options [shareController setValue:subject forKey:@"subject"]; } + NSArray *excludedActivityTypes = [RCTConvert NSStringArray:options[@"excludedActivityTypes"]]; + if (excludedActivityTypes) { + shareController.excludedActivityTypes = excludedActivityTypes; + } + UIViewController *controller = RCTKeyWindow().rootViewController; #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0