Skip to content

Commit

Permalink
ActionSheetIOS - Pass URL, not file contents to UIActivityViewControl…
Browse files Browse the repository at this point in the history
…ler 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: #8442
Closes #9693

Differential Revision: D3821142

Pulled By: javache

fbshipit-source-id: a06128db88d24cf5565169f321365ace43ab89fe
  • Loading branch information
sheparddw authored and Facebook Github Bot 3 committed Sep 6, 2016
1 parent 0d176b3 commit 4f004fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/ActionSheetIOS/RCTActionSheetManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ - (CGRect)sourceRectInView:(UIView *)sourceView
}
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
Expand Down

0 comments on commit 4f004fa

Please sign in to comment.