@@ -544,21 +544,33 @@ - (void)indexUsingNSUserActivity:(NSDictionary *)params {
544544 // if no view controller, don't index. Current use case: iMessage extensions
545545 return ;
546546 }
547+ #pragma clang diagnostic push
548+ #pragma clang diagnostic ignored "-Wpartial-availability"
549+
547550 NSString *uniqueIdentifier = [NSString stringWithFormat: @" io.branch.%@ " , [[NSBundle mainBundle ] bundleIdentifier ]];
551+
548552 // Can't create any weak references here to the userActivity, otherwise it will not index.
549553 activeViewController.userActivity = [[NSUserActivity alloc ] initWithActivityType: uniqueIdentifier];
550554 activeViewController.userActivity .delegate = self;
551555 activeViewController.userActivity .title = params[@" title" ];
552556 activeViewController.userActivity .webpageURL = [NSURL URLWithString: params[@" url" ]];
553557 activeViewController.userActivity .eligibleForSearch = YES ;
554558 activeViewController.userActivity .eligibleForPublicIndexing = [params[@" publiclyIndexable" ] boolValue ];
555- activeViewController.userActivity .userInfo = self.userInfo ; // This alone doesn't pass userInfo through
556- activeViewController.userActivity .requiredUserInfoKeys = [NSSet setWithArray: self .userInfo.allKeys]; // This along with the delegate method userActivityWillSave, however, seem to force the userInfo to come through.
559+
560+ // This alone doesn't pass userInfo through
561+ activeViewController.userActivity .userInfo = self.userInfo ;
562+
563+ // This along with the delegate method userActivityWillSave, however, seem to force the userInfo to come through.
564+ activeViewController.userActivity .requiredUserInfoKeys = [NSSet setWithArray: self .userInfo.allKeys];
565+
557566 activeViewController.userActivity .keywords = params[@" keywords" ];
558567 SEL setContentAttributeSetSelector = NSSelectorFromString (@" setContentAttributeSet:" );
559- ((void (*)(id , SEL , id ))[activeViewController.userActivity methodForSelector: setContentAttributeSetSelector])(activeViewController.userActivity , setContentAttributeSetSelector, params[@" attributeSet" ]);
568+ ((void (*)(id , SEL , id ))[activeViewController.userActivity methodForSelector: setContentAttributeSetSelector])
569+ (activeViewController.userActivity , setContentAttributeSetSelector, params[@" attributeSet" ]);
560570
561571 [activeViewController.userActivity becomeCurrent ];
572+
573+ #pragma clang diagnostic pop
562574}
563575
564576@end
0 commit comments