Giter Site home page Giter Site logo

react-qrcode-deep-link's Introduction

QR Code Deep Link Generator

This proof-of-concept (POC) aims to demonstrate both how to generate custom QR codes and how to use those as deep-links into your mobile application.

For the current exercise, we will deep-link into a given Instagram profile.

You can see it working at https://schonarth.github.io/react-qrcode-deep-link/

The Moving Parts

This contraption is comprised of the following elements:

  • The QR Code Generator, where you create a URL with all the parameters you want to eventually pass to the app
  • The Loader, which sits at the URL to which the QR code points to, and will decide what to do with it.
  • The mobile application, which needs to be able to receive deep-link parameters

The QR Code Generator

A QR code is essentially a barcode on steroids. Whereas barcodes could only represent numbers and letters, QR codes can store long (up to ~7k chars) and complex strings of text as needed. It's also error-resistant with redundancy included, so damaged or partially covered up codes can usually be read successfully.

QR codes are most often used for URLs, but you can use them for pretty much anything.

Lorem ipsum dolor sit amet...
As plain text
.eslintrc
As code

Storing plain data as above allows IT devices to get information about a physical parcel with no connection requirements, for instance (just beware of sensitive information).

You can also customize the QR code with fancy visuals. This is a simple custom theme example for the same app.

Modern phones' cameras can read most QR codes and, conveniently, they can also identify and follow URLs. Which leads us to the second moving part of our little contraption...

The Loader

In order to create a deep link, you need to both generate QR codes with URLs and a website where these URLs point to. Bear in mind, they aren't pointing directly to the mobile app. The first step is a regular page, which can be your main web app or a separate, smaller one just for this purpose.

This web app needs to be able to:

  • Receive the URL parameters and know what to do with them;
  • Open the mobile app if the page is accessed from such a device and the app is installed;
  • Send users to the appropriate mobile app store (Apple's or Google's) if the app is not installed;
  • Show a message if none of the conditions are met ('please access this from a mobile device')

In the case of this small proof-of-concept, both Loader and Generator are sitting right next to each other, but in a more production-like environment, you'd expect them to be in completely different parts of your application.

The Mobile App

Finally, your mobile app. The Loader launches it via a special URL for each OS, and any parameters you want to send it are embedded in this URL. The app itself needs to be able to get these parameters and start your intended action based on them.

Also, you need to have them published in order to have functioning redirection to the app stores.

In this example, we are deep-linking into the mobile Instagram app, passing it a username so the app opens directly into that profile.

react-qrcode-deep-link's People

Contributors

schonarth avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.