From 4f004fa3e533b716ea356f423e6ff1ef43c88559 Mon Sep 17 00:00:00 2001 From: sheparddw Date: Tue, 6 Sep 2016 04:32:36 -0700 Subject: [PATCH] ActionSheetIOS - Pass URL, not file contents to UIActivityViewController for file URLs. Summary: Currently, when sharing local files, the file contents are being sent as NSData causing the file to never be attached when sharing via Email or via Airdrop, being renamed to something obscure such as (null)-257D026032E9-1.data Simply passing the Local File URL to UIActivityViewController instead of the file contents resolves this issue. More info on this issue: https://github.com/facebook/react-native/issues/8442 Closes https://github.com/facebook/react-native/pull/9693 Differential Revision: D3821142 Pulled By: javache fbshipit-source-id: a06128db88d24cf5565169f321365ace43ab89fe --- Libraries/ActionSheetIOS/RCTActionSheetManager.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/ActionSheetIOS/RCTActionSheetManager.m b/Libraries/ActionSheetIOS/RCTActionSheetManager.m index 5c1da760444..ca42f0d9e29 100644 --- a/Libraries/ActionSheetIOS/RCTActionSheetManager.m +++ b/Libraries/ActionSheetIOS/RCTActionSheetManager.m @@ -135,7 +135,7 @@ RCT_EXPORT_METHOD(showShareActionSheetWithOptions:(NSDictionary *)options } NSURL *URL = [RCTConvert NSURL:options[@"url"]]; if (URL) { - if (URL.fileURL || [URL.scheme.lowercaseString isEqualToString:@"data"]) { + if ([URL.scheme.lowercaseString isEqualToString:@"data"]) { NSError *error; NSData *data = [NSData dataWithContentsOfURL:URL options:(NSDataReadingOptions)0