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

EXKernelLinkingManager will always send nil URLs for universal links #1692

Closed
dodgecm opened this issue Apr 25, 2018 · 3 comments
Closed

EXKernelLinkingManager will always send nil URLs for universal links #1692

dodgecm opened this issue Apr 25, 2018 · 3 comments
Assignees

Comments

@dodgecm
Copy link

dodgecm commented Apr 25, 2018

Environment

Environment:
OS: macOS High Sierra 10.13.4
Node: 7.8.0
Yarn: 1.5.1
npm: 5.6.0
Watchman: Not Found
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.1 AI-173.4697961

Packages: (wanted => installed)
expo: ^26.0.0 => 26.0.0
react: 16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: https://github.com/expo/react-native/archive/sdk-26.0.0.tar.gz => 0.54.2

Diagnostics report:
https://exp-xde-diagnostics.s3.amazonaws.com/guilded-1e357d22-0f9b-4218-ade3-b47e6fbdbd7c.tar.gz

Target: iOS ExpoKit

Relevant method in EXKernalLinkingManager:

- (void)openUrl:(NSString *)urlString isUniversalLink:(BOOL)isUniversalLink
{
  NSURL *url = [NSURL URLWithString:urlString];
  ...
  EXKernelAppRegistry *appRegistry = [EXKernel sharedInstance].appRegistry;
  EXKernelAppRecord *destinationApp = nil;
  NSURL *urlToRoute = nil;

  if (isUniversalLink && [EXShellManager sharedInstance].isShell) {
    destinationApp = [EXKernel sharedInstance].appRegistry.standaloneAppRecord;
  } else {
    ...
    }
  }

  if (destinationApp) {
    [[EXKernel sharedInstance] sendUrl:urlToRoute.absoluteString toAppRecord:destinationApp];
  } else {
    ...
  }
}

Reproduction steps are:

  1. Open a universal link in iOS safari that points to my app.

I've omitted the else blocks to show the problematic code path. If it's a universal link and a destination app is found, urlToRoute is never set, which ends up causing a crash in EXLinkingManager.

@terribleben
Copy link
Contributor

Thanks for the report and the codepath. Janic is working on updating our Branch dep right now so he'll probably hit/fix this in the meantime.

@terribleben
Copy link
Contributor

Also, we maybe (?) already fixed this in SDK 27, such that the RHS is url instead of nil by default:

@dodgecm
Copy link
Author

dodgecm commented Apr 26, 2018

Yes, that looks like it should fix the problem, I'm going to go ahead and close this.

@dodgecm dodgecm closed this as completed Apr 26, 2018
@lock lock bot added the outdated label Jun 14, 2019
@lock lock bot locked and limited conversation to collaborators Jun 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants