Skip to content

Commit 19e4fc6

Browse files
authored
Merge pull request #227 from beast911/iosShareTitleBug
iOS fix shareTitle and shareText
2 parents 37abed0 + de736c6 commit 19e4fc6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ios/dependencies/Branch-SDK/BranchUniversalObject.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ - (void)showShareSheetWithLinkProperties:(BranchLinkProperties *)linkProperties
184184
UIActivityItemProvider *itemProvider = [self getBranchActivityItemWithLinkProperties:linkProperties];
185185
NSMutableArray *items = [NSMutableArray arrayWithObject:itemProvider];
186186
if (shareText) {
187-
[items insertObject:shareText atIndex:0];
187+
[items insertObject:[shareText valueForKey:@"shareText"] atIndex:0];
188188
}
189189
UIActivityViewController *shareViewController = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];
190190

@@ -224,6 +224,13 @@ - (void)showShareSheetWithLinkProperties:(BranchLinkProperties *)linkProperties
224224
@catch (NSException *exception) {
225225
[_preferenceHelper logWarning:@"Unable to setValue 'emailSubject' forKey 'subject' on UIActivityViewController."];
226226
}
227+
} else if ([shareText valueForKey:@"shareTitle"] != nil) {
228+
@try {
229+
[shareViewController setValue:[shareText valueForKey:@"shareTitle"] forKey:@"subject"];
230+
}
231+
@catch (NSException *exception) {
232+
[_preferenceHelper logWarning:@"Unable to setValue 'emailSubject' forKey 'subject' on UIActivityViewController as shareTitle is missing"];
233+
}
227234
}
228235

229236
if (presentingViewController) {

0 commit comments

Comments
 (0)