mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 21:46:07 +08:00
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
This commit is contained in:
committed by
facebook-github-bot-4
parent
c929e15523
commit
0f0b57880f
@@ -90,6 +90,9 @@ var ShareActionSheetExample = React.createClass({
|
|||||||
url: 'https://code.facebook.com',
|
url: 'https://code.facebook.com',
|
||||||
message: 'message to go with the shared url',
|
message: 'message to go with the shared url',
|
||||||
subject: 'a subject to go in the email heading',
|
subject: 'a subject to go in the email heading',
|
||||||
|
excludedActivityTypes: [
|
||||||
|
'com.apple.UIKit.activity.PostToTwitter'
|
||||||
|
]
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
@@ -172,6 +172,11 @@ RCT_EXPORT_METHOD(showShareActionSheetWithOptions:(NSDictionary *)options
|
|||||||
[shareController setValue:subject forKey:@"subject"];
|
[shareController setValue:subject forKey:@"subject"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSArray *excludedActivityTypes = [RCTConvert NSStringArray:options[@"excludedActivityTypes"]];
|
||||||
|
if (excludedActivityTypes) {
|
||||||
|
shareController.excludedActivityTypes = excludedActivityTypes;
|
||||||
|
}
|
||||||
|
|
||||||
UIViewController *controller = RCTKeyWindow().rootViewController;
|
UIViewController *controller = RCTKeyWindow().rootViewController;
|
||||||
|
|
||||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
|
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
|
||||||
|
|||||||
Reference in New Issue
Block a user