Skip to content

Commit

Permalink
Merge pull request #227 from beast911/iosShareTitleBug
Browse files Browse the repository at this point in the history
iOS fix shareTitle and shareText
  • Loading branch information
aaustin authored Nov 7, 2016
2 parents 37abed0 + de736c6 commit 19e4fc6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ios/dependencies/Branch-SDK/BranchUniversalObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ - (void)showShareSheetWithLinkProperties:(BranchLinkProperties *)linkProperties
UIActivityItemProvider *itemProvider = [self getBranchActivityItemWithLinkProperties:linkProperties];
NSMutableArray *items = [NSMutableArray arrayWithObject:itemProvider];
if (shareText) {
[items insertObject:shareText atIndex:0];
[items insertObject:[shareText valueForKey:@"shareText"] atIndex:0];
}
UIActivityViewController *shareViewController = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];

Expand Down Expand Up @@ -224,6 +224,13 @@ - (void)showShareSheetWithLinkProperties:(BranchLinkProperties *)linkProperties
@catch (NSException *exception) {
[_preferenceHelper logWarning:@"Unable to setValue 'emailSubject' forKey 'subject' on UIActivityViewController."];
}
} else if ([shareText valueForKey:@"shareTitle"] != nil) {
@try {
[shareViewController setValue:[shareText valueForKey:@"shareTitle"] forKey:@"subject"];
}
@catch (NSException *exception) {
[_preferenceHelper logWarning:@"Unable to setValue 'emailSubject' forKey 'subject' on UIActivityViewController as shareTitle is missing"];
}
}

if (presentingViewController) {
Expand Down

0 comments on commit 19e4fc6

Please sign in to comment.