npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

deep-linking-react-native

v1.0.2

Published

deep-linking-react-native is a React-Native component which is added to the **first rendered component** to enable the application to be accessed through deep links.

Downloads

26

Readme

Deep Linking React Native

Overview

deep-linking-react-native is a React-Native component which is added to the first rendered component to enable the application to be accessed through deep links.

Installation

npm install deep-linking-react-native --save

Usage

Setting DeepLinks on native code

You can follow following link that guides through adding deep linking to your native code. It's straight forward. Deep Linking native configuration - We need only "Configuring iOS" and "Configuring Android".

Add component

Add "DeepLinking" component to your first rendered component

import {Component} from "React";
import {View} from "react-native"
import DeepLinking from "deep-linking-react-native";

import deepLinkingScheme from "./DeepLinkingScheme" //you can find this example file in the project directory

class Home extends Component{
	render(){
		return (
				<View>
					<DeepLinking scheme={{ scheme: deepLinkingScheme }} />
					<View>
					{
						//other components and stuff...
					}
					</View>
				</View>
			)
	}
}
	

Setting up your scheme:

It's a Scheme object from 'Scheme.js' which have two params : name, routes.

  • name: the name of the deepLinking route which must be identical to the one configured in the native code.
  • routes: array of JSON objects with the following two properties:
    • expression: route as string example: '/users/signup/'
    • callback: funcation that receives two oprional JSON objects (props and callbacks) that will be used for example to navigate to a screen

example:

import Scheme from './Scheme';
import { Actions } from 'react-native-router-flux';

export default deepLinkingScheme=new Scheme("deepLinkingScheme",
	[
		{
	        expression: '/signup/:first_name/:last_name/:email/:mobile_phone',
	        callback: ({first_name,last_name,email,mobile_phone},{updateData})=>{
	                Actions.signUpWindow();

	                updateData({
		                	name:first_name+" "+last_name,
		                	email:email,
		                	phone:mobile_phone
	                	})

	            }
	    }
	    {
	    	expression: '/my-profile/',
	    	callback: ()=> Actions.profile()
	    }
    ]
)

Provide the props and actions:

You will have to edit DeepLinking component by importing the actions (Redux actions) that will be passed to the callbacks, and add the needed props to mapStateToProps function that will also be passed to the callbacks.

example:

import { signupAction } from '../../../actions/';

class DeepLinking extends Component{
	//....
}

const mapStateToProps = (state) => {
    return { 
    	signUpState: state.signup
     };
};

export default connect(mapStateToProps,{
	signupAction
})(DeepLinking)

This will make signupAction and signUpState to be passed to the callbacks in the Scheme.

Feel free to submit issues.

By Ammar Rajab