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

Implement deep link functionality and enable it for android. #4775

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

AkashDhiman
Copy link
Member

@AkashDhiman AkashDhiman commented Jun 3, 2021

The implementation in this PR allows user to open mobile app from a special zulip:// link.
Current implementation is able to navigate to groups, PMs, streams, topics, mentions and starred messages as manually tested by me.
See the documentation addition in d787626a8 to efficiently do a manual test yourself.

Behavior

  • On receiving an appropriate zulip:// link, if the realm+email on the link matches with current active account, user will be navigated to the specific screen guided by the link.
  • If the app is in background it comes to foreground and navigates, if it wasn't running, it starts and navigates.
  • If the realm+email is not loggedIn, user is navigated to realmInputScreen.

Caveats

Marking partly fixed because of the caveats.

Fixes-part-of: #4751

LinkingEvent is going to be used in multiple files in the following
commits and hence it is better to export it from a common file.
This will help us in moving `webAuthBegin`, `webAuthEnd` from
`AuthScreen` to `webAuth.js` which is a better place to put them
from a reusability point of view.

This commit also involves modifying the associated code in
`AuthScreen`, `webAuth.js` and `webAuth-test.js`.

Specifically, these changes are being made to implement deep link
functionality in the following commits.
This change is done to centralise the handling of urls received by
our app which will be required to implement deep linking.

With this modification webAuth can be initiated from any component
with appropriate parameters.

Note that this commit also stops exporting some functions from
`webAuth.js` as this is no longer needed, and updates the jsdocs of
`beginWebAuth` and `endWebAuth`.
This commit shifts the logic that handles auth urls; from
`AuthScreen` to `AppEventHandlers`.
@AkashDhiman AkashDhiman requested a review from gnprice June 3, 2021 10:57
`internalLink.js` provides us many function that can also be
utilised to process deep links. Doing this however required few
simple modifications.

This commit adds `isDeepLink` function, modifies getLinkType in
order to be compatible with deep links and renames `internalLink.js`
to `linkProcessors.js`.
This action will be responsible to generate a narrow from a valid
navigation deep link url, and then navigate to it.

Limitation of current Implementation:
- if the link points to a different account, we only switch the
account and don't actually navigate to it. (similar to zulip#4630)
This involves creating a `handleUrl` function that checks if deep
link url is a login url or a navigation url and forwards
the execution accordingly.
Caveats:
- current navigation does not work across accounts.

Fixes-part-of: zulip#4751
- In this commit, instructions are only provided for android.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants