Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS AppDelegate integration #8

Open
martinlockett opened this issue Jan 15, 2018 · 3 comments
Open

iOS AppDelegate integration #8

martinlockett opened this issue Jan 15, 2018 · 3 comments

Comments

@martinlockett
Copy link

In AppDelegate the method - (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray * _Nullable))restorationHandler { returns (quote from Apple Docs)

YES to indicate that your app handled the activity or NO to let iOS know that your app did not handle the activity.

The instructions for this library are to call a void method [RCTSpotlightSearch handleContinueUserActivity:userActivity]; and then always return YES. I want to add another potential method return [RNBranch continueUserActivity:userActivity];
For the correct return value and processing logic [RCTSpotlightSearch handleContinueUserActivity:userActivity] should therefore not be void but return YES or NO

@jdmunro
Copy link
Owner

jdmunro commented Jan 15, 2018

I can't in all honesty remember why I initially implemented it this way - feel free to create a PR with your proposed changes 😃

@seftonmonk
Copy link

seftonmonk commented Sep 1, 2021

Trying to add RCTSpotlightSearch into the AppDelegate, however i cant seem to get both my existing RCTLinkingManager to work along side it. any suggestions?

- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler { return [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; }

@sakshya73
Copy link
Contributor

sakshya73 commented Oct 20, 2021

I was getting the same issue and I don't know exactly if this is the right way but I resolved it by merging both the functions.

// Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
  [RCTSpotlightSearch handleContinueUserActivity:userActivity];
  return YES;
  return [RCTLinkingManager application:application
                   continueUserActivity:userActivity
                     restorationHandler:restorationHandler];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants