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
This commit is contained in:
parent
0d176b3337
commit
4f004fa3e5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue