@@ -392,55 +392,26 @@ - (NSString *)getLongUrlWithChannel:(NSString *)channel
392392#if !TARGET_OS_TV
393393
394394- (void )showShareSheetWithShareText : (NSString *)shareText
395- completion : (void (^ _Nullable)(NSString * _Nullable activityType, BOOL completed))completion {
396- [self showShareSheetWithLinkProperties: nil andShareText: shareText fromViewController: nil completion: completion];
397- }
398-
399- - (void )showShareSheetWithLinkProperties : (BranchLinkProperties *)linkProperties
400- andShareText : (NSString *)shareText
401- fromViewController : (UIViewController *)viewController
402- completion : (void (^ _Nullable)(NSString * _Nullable activityType, BOOL completed))completion {
403- [self showShareSheetWithLinkProperties: linkProperties andShareText: shareText
404- fromViewController: viewController anchor: nil completion: completion orCompletionWithError: nil ];
395+ completion : (void (^ _Nullable)(NSString * _Nullable activityType, BOOL completed, NSError *_Nullable error))completion {
396+ [self showShareSheetWithLinkProperties: nil andShareText: shareText fromViewController: nil completionWithError: completion];
405397}
406398
407399- (void )showShareSheetWithLinkProperties : (BranchLinkProperties *)linkProperties
408400 andShareText : (NSString *)shareText
409401 fromViewController : (UIViewController *)viewController
410402 completionWithError : (void (^ _Nullable)(NSString * _Nullable activityType, BOOL completed, NSError *_Nullable error))completion {
411- [self showShareSheetWithLinkProperties: linkProperties andShareText: shareText
412- fromViewController: viewController anchor: nil completion: nil orCompletionWithError: completion];
413- }
414-
415- - (void )showShareSheetWithLinkProperties : (nullable BranchLinkProperties *)linkProperties
416- andShareText : (nullable NSString *)shareText
417- fromViewController : (nullable UIViewController *)viewController
418- anchor : (nullable id )anchor
419- completion : (void (^ _Nullable)(NSString * _Nullable activityType, BOOL completed))completion {
420- [self showShareSheetWithLinkProperties: linkProperties andShareText: shareText
421- fromViewController: viewController anchor: anchor completion: completion orCompletionWithError: nil ];
422- }
423-
424- - (void )showShareSheetWithLinkProperties : (nullable BranchLinkProperties *)linkProperties
425- andShareText : (nullable NSString *)shareText
426- fromViewController : (nullable UIViewController *)viewController
427- anchor : (nullable id )anchor
428- completionWithError : (void (^ _Nullable)(NSString * _Nullable activityType, BOOL completed, NSError *_Nullable error))completion {
429- [self showShareSheetWithLinkProperties: linkProperties andShareText: shareText
430- fromViewController: viewController anchor: anchor completion: nil orCompletionWithError: completion];
403+ [self showShareSheetWithLinkProperties: linkProperties andShareText: shareText fromViewController: viewController anchor: nil completionWithError: completion];
431404}
432405
433406- (void )showShareSheetWithLinkProperties : (BranchLinkProperties *)linkProperties
434407 andShareText : (NSString *)shareText
435408 fromViewController : (UIViewController *)viewController
436409 anchor : (nullable id )anchorViewOrButtonItem
437- completion : (void (^ _Nullable)(NSString * _Nullable activityType, BOOL completed))completion
438- orCompletionWithError : (void (^ _Nullable)(NSString * _Nullable activityType, BOOL completed, NSError *_Nullable error))completionError {
410+ completionWithError : (void (^ _Nullable)(NSString * _Nullable activityType, BOOL completed, NSError *_Nullable error))completion {
439411
440412 BranchShareLink *shareLink = [[BranchShareLink alloc ] initWithUniversalObject: self linkProperties: linkProperties];
441413 shareLink.shareText = shareText;
442- shareLink.completion = completion;
443- shareLink.completionError = completionError;
414+ shareLink.completionError = completion;
444415 [shareLink presentActivityViewControllerFromViewController: viewController anchor: anchorViewOrButtonItem];
445416}
446417
@@ -464,8 +435,7 @@ - (void)listOnSpotlightWithIdentifierCallback:(callbackWithUrlAndSpotlightIdenti
464435 BOOL publiclyIndexable;
465436 if (self.contentIndexMode == BranchContentIndexModePrivate) {
466437 publiclyIndexable = NO ;
467- }
468- else {
438+ } else {
469439 publiclyIndexable = YES ;
470440 }
471441
@@ -500,17 +470,15 @@ - (void)listOnSpotlightWithLinkProperties:(BranchLinkProperties*_Nullable)linkpr
500470 }];
501471}
502472
503- - (void ) removeFromSpotlightWithCallback : (void (^_Nullable)(NSError * _Nullable error))completion {
473+ - (void )removeFromSpotlightWithCallback : (void (^_Nullable)(NSError * _Nullable error))completion {
504474 if (self.locallyIndex ) {
505- [[Branch getInstance ] removeSearchableItemWithBranchUniversalObject: self
506- callback: ^(NSError *error) {
507- if (completion) {
508- completion (error);
509- }
510- }];
475+ [[Branch getInstance ] removeSearchableItemWithBranchUniversalObject: self callback: ^(NSError *error) {
476+ if (completion) {
477+ completion (error);
478+ }
479+ }];
511480 } else {
512- NSError *error = [NSError branchErrorWithCode: BNCSpotlightPublicIndexError
513- localizedMessage: @" Publically indexed cannot be removed from Spotlight" ];
481+ NSError *error = [NSError branchErrorWithCode: BNCSpotlightPublicIndexError localizedMessage: @" Publically indexed cannot be removed from Spotlight" ];
514482 if (completion) completion (error);
515483 }
516484}
0 commit comments