Listening for incoming links on Android with React-Native

前端 未结 1 864
梦毁少年i
梦毁少年i 2021-02-11 01:46

I am able to listen and handle incoming links on IOS with react-native using the linking library: https://facebook.github.io/react-native/docs/linking.html, but it shows the fun

1条回答
  •  失恋的感觉
    2021-02-11 02:40

    I just got it working! You just have to follow these instructions.

    Basically, add an under the existing one of your android/app/src/main/AndroidManifest.xml, containing the VIEW action, the DEFAULT and BROWSABLE categories, and at least a .

    Then simply rebuild and reinstall your APK (react-native run-android), that's it! Links matching your tags will now open in your app!

    Now just catch this URL with Linking.getInitialURL() in the componentDidMount() of your main Javascript class!

    Example of manifest:

    
    
      
      
    
      
    
      
    
        
          
            
            
          
    
          
          
            
            
            
            
            
            
            
          
    
        
        
      
    
    
    

    0 讨论(0)
提交回复
热议问题