GithubHelp home page GithubHelp logo

isabella232 / store-switcher Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 764 KB

App Store Switcher is a framework-agnostic utility that automatically redirects site visitors to the appropriate app store based from the OS of their device.

JavaScript 2.57% TypeScript 97.43%

store-switcher's Introduction

App Store Switcher

App Store Switcher is a framework-agnostic utility that automatically redirects site visitors to the appropriate app store based from the OS of their device.

Supported devices at the moment is iOS and Android.

Getting Started

Using the pre-made dist

  1. Clone this repository
  2. Contents of the /dist can be hosted anywhere and is ready for-use.

Building on your own:

  1. Clone this repository.
  2. Install dependencies in the project (run yarn or yarn install, npm or npm install if you're using npm)
  3. Run yarn build
  4. In the /dist folder, you'll see the compiled files which you can host anywhere, statically.

Usage

Let's say you've hosted your app in the link example.com, you need to provide 3 link parameters in order for the redirection to work, the required parameters are that links the user to the appropriate store.

Required parameters when visiting example.com

Parameter Description Example
android_appId Android App ID com.ubercab of
play.google.com/store/apps/details?id=com.ubercab
apple_developerId Apple Developer ID uber of
apps.apple.com/us/app/uber/id368677368
apple_appId Apple App ID id368677368 of
apps.apple.com/us/app/uber/id368677368

A final link example would be:
example.com/?android_appId=com.ubercab&apple_developerId=uber&apple_appId=id368677368

Behavior

If the device is part of the supported OS, Android/iOS, the static file redirects the user automatically to the appropriate app store, otherwise, a fallback page will be shown. This fallback page contains two badges: Play Store and App Store badges.

Testing:

Simply run yarn:test on the project directory and you're good to go.

store-switcher's People

Contributors

jacklaurencegaray 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.