- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 676
Implement deep link functionality and enable it for android. #4775
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
          
     Open
      
      
            AkashDhiman
  wants to merge
  10
  commits into
  zulip:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
AkashDhiman:deeplink
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    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`.
`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.
  This was referenced Apr 20, 2023 
      
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
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
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.realmInputScreen.Caveats
Marking partly fixed because of the caveats.
Fixes-part-of: #4751