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

Universal Linking component #4546

Closed
wants to merge 1 commit into from
Closed

Conversation

chirag04
Copy link
Contributor

@chirag04 chirag04 commented Dec 3, 2015

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
Contributor

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

@facebook-github-bot facebook-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
Copy link
Contributor

vjeux commented Dec 3, 2015

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

@philikon
Copy link
Contributor

philikon commented Dec 3, 2015

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

@satya164
Copy link
Contributor

satya164 commented Dec 4, 2015

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
Contributor

satya164 commented Dec 4, 2015

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
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
Contributor

satya164 commented Dec 4, 2015

@nicklockwood Any ideas for a Good name?

@nicklockwood
Copy link
Contributor

Something like Routing? or URLRouting?

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

@satya164
Copy link
Contributor

satya164 commented Dec 4, 2015

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

Yeah, names are pretty damn hard :(

@chirag04
Copy link
Contributor Author

chirag04 commented Dec 4, 2015

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
Contributor

satya164 commented Dec 4, 2015

@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
Contributor Author

chirag04 commented Dec 4, 2015

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
Contributor

mkonicek commented Dec 9, 2015

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
Contributor

mkonicek commented Dec 9, 2015

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

@chirag04
Copy link
Contributor Author

@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
Contributor

No problem, enjoy your vacation @chirag04 :)

@facebook-github-bot
Copy link
Contributor

@chirag04 updated the pull request.

@@ -20,7 +20,7 @@ var {
AlertIOS,
CameraRoll,
Image,
LinkingIOS,
Linking,

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
Contributor Author

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
Contributor

@chirag04 updated the pull request.

@chirag04
Copy link
Contributor Author

@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.

@@ -20,7 +20,7 @@ var {
AlertIOS,
CameraRoll,
Image,
LinkingIOS,
Linking,

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
Contributor

@chirag04 updated the pull request.

@satya164
Copy link
Contributor

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

@bozzmob
Copy link
Contributor

bozzmob commented Dec 30, 2015

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
Contributor Author

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

cc @mkonicek

@satya164
Copy link
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
Contributor

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

@bozzmob
Copy link
Contributor

bozzmob commented Dec 31, 2015

@satya164 Agree with you.

@mkonicek
Copy link
Contributor

mkonicek commented Jan 6, 2016

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
Contributor

mkonicek commented Jan 6, 2016

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
Contributor

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

@satya164
Copy link
Contributor

satya164 commented Jan 6, 2016

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

@mkonicek
Copy link
Contributor

mkonicek commented Jan 6, 2016

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

@chirag04
Copy link
Contributor Author

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

@chirag04 chirag04 closed this Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Platform: iOS iOS applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants