Skip to content

Universal Linking component - #4546

Closed
chirag04 wants to merge 1 commit into
react:masterfrom
chirag04:linking
Closed

Universal Linking component#4546
chirag04 wants to merge 1 commit into
react:masterfrom
chirag04:linking

Conversation

@chirag04

Copy link
Copy Markdown
Contributor

A lot of code is redundant in IntentAndroid and LinkingIOS. This bridges that gap.
Not sure what we should do with IntentAndroid.js and LinkingIOS.js if we merge this.

cc @mkonicek@ide@brentvatne

@facebook-github-bot

Copy link
Copy Markdown
Contributor

By analyzing the blame information on this pull request, we identified @philikon, @nicklockwood and @vjeux to be potential reviewers.

@facebook-github-botfacebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Dec 3, 2015
@vjeux

vjeux commented Dec 3, 2015

Copy link
Copy Markdown
Contributor

cc @dmmiller who's running the effort of unifying iOS and Android apis :)

@philikon

Copy link
Copy Markdown
Contributor

Could the diff be expressed as a rename of LinkingIOS.js to Linking.js please?

@satya164

Copy link
Copy Markdown
Contributor

I think we should show a warning when someone tries to use the events on Android.

Also, deep linking on Android is not supported on master, I've a pull request open here #4320 . However, I need to test it with my latest changes before I get it merged.

@satya164

Copy link
Copy Markdown
Contributor

BTW, currently we have 3 different files, LinkingIOS, IntentAndroid and Linking. We could merge them to a single Linking.js file and just export it as LinkingIOS, IntentAndroid and Linking for backward compatibility.

@nicklockwood

Copy link
Copy Markdown
Contributor

Is "Linking" a good name for this? I can't say I'm a fan of it. If we're renaming it anyway, might as well pick something we like.

@satya164

Copy link
Copy Markdown
Contributor

@nicklockwood Any ideas for a Good name?

@nicklockwood

Copy link
Copy Markdown
Contributor

Something like Routing? or URLRouting?

I don't know. Names are hard ¯_(ツ)_/¯

@satya164

Copy link
Copy Markdown
Contributor

@nicklockwood Routing sounds like it has something to do with React (Native) Router :|

Yeah, names are pretty damn hard :(

@chirag04

Copy link
Copy Markdown
ContributorAuthor

Agree with you guys. How about url or history?

@satya164: having one file and exporting it as linkingios, intentAndroid etc sounds like a good plan

@satya164

Copy link
Copy Markdown
Contributor

@chirag04 Nah, URL means, well URL (URL.openURL(url: string) is kinda weird), and History is more like what the Navigators does.

@chirag04

Copy link
Copy Markdown
ContributorAuthor

yeah. let's wait for more suggestions. I will update the PR accordingly. My plan was to start a discussion around this with this PR :)

@mkonicek

Copy link
Copy Markdown
Contributor

Thanks for doing this! We should remove LinkingIOS and IntentAndroid in a followup PR, will need to update internal fb code with that.

I don't mind the name Linking - it's used to open external "links".

Looks like you need to rebase, sorry for the delay. Have many PRs in the queue and doing the branch cut for 0.17.

@mkonicek

Copy link
Copy Markdown
Contributor

Adding a label so I don't forget about this PR.

@chirag04

Copy link
Copy Markdown
ContributorAuthor

@mkonicek I'm on vacation till 26th Dec. I will try to rebase and submit the follow up PR soon. Keeping it open till then.

@mkonicek

Copy link
Copy Markdown
Contributor

No problem, enjoy your vacation @chirag04 :)

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@chirag04 updated the pull request.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

property Linking Property not found in Object.create

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the bot linting against my PR branch or master?

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@chirag04 updated the pull request.

@chirag04

Copy link
Copy Markdown
ContributorAuthor

@mkonicek This should be go to go now. let me know we need any modification. Happy to submit subsequent PR to remove other files once we get this merged.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

property Linking Property not found in Object.create

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@chirag04 updated the pull request.

@satya164

Copy link
Copy Markdown
Contributor

@chirag04IntentAndroid doesn't have a popInitialURL method. It has a getInitialURL method which accepts a callback.

@satvikmaker

Copy link
Copy Markdown
Contributor

How about the name LinkTo sound?

  • Link to open URL
  • Link to open app

to here is more like referring to something.

@chirag04

Copy link
Copy Markdown
ContributorAuthor

@satya164 Seems like it was added recently. Thoughts on how we can support both the platforms?

cc @mkonicek

@satya164

Copy link
Copy Markdown
Contributor

@chirag04 May be the cross-paltform one can have the callback based getInitialURl as both scenarios can be supported by this. Android cannot have a synchronous method because of reasons outlined here - #4320

@satya164

Copy link
Copy Markdown
Contributor

@bozzmob Not a fan of it. There are method like getInitialURL and addEventListener, which don't sound quite right.

@satvikmaker

Copy link
Copy Markdown
Contributor

@satya164 Agree with you.

@mkonicek

Copy link
Copy Markdown
Contributor

I'm not familiar with how the initial URL works on Android. @satya164, @chirag04 you have more knowledge, feel free to decide on a solution and ship this.

@mkonicek

Copy link
Copy Markdown
Contributor

Looks like it's a constant on iOS and a method on Android? Don't have a strong preference - if it's hard to make it a constant on Android can we just make it a function with a callback in Linking, returning the constant on iOS and calling the method on Android? Up to you.

@nicklockwood

Copy link
Copy Markdown
Contributor

Couldn't you implement popInitialURL on Android by calling getInitialURL internally and then popping to it?

@satya164

Copy link
Copy Markdown
Contributor

@nicklockwood We could. But it can change, and having it in a constant will be confusing.

@mkonicek

Copy link
Copy Markdown
Contributor

Yeah, I'm not sure when to call getInitialURL. Having a function instead of a constant might be easier?

@chirag04

Copy link
Copy Markdown
ContributorAuthor

closing in favor of #5336. Let's continue the discussion there.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.Platform: iOSiOS applications.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@chirag04@facebook-github-bot@vjeux@philikon@satya164@nicklockwood@mkonicek@satvikmaker@eslint-bot@skevy