Code Monkey home page Code Monkey logo

deeplinkingtonativeapp's Introduction

Browser DeepLinking to Native App

JavaScript to DeepLink to Native App. Redirect from mobile browser to native app.

Based on the modern mobile browsers, I have compiled down different deeplinking implementation as following:

DirectAppLaunchStrategy

This is the most common deeplinking strategy/implementation where browser tries to open app using Iframe or window.location, and then to app store after few seconds as soon as window is loaded. Most of the browsers still support this.

DirectAppOnlyLaunchStrategy

This is same as DirectAppLaunchStrategy, but it only tries to open app, not app store. Twitter browser on iOS8, opens 'Open URL..' dialog box and also redirects to app store without waiting for 'Open Url' dialog box to get dismissed. This is only used for iOS8 Twitter Browser.

CTAAppLaunchStrategy (Call to Action)

This requires user action to redirect to app or app store. Landing page needs to have element with id attribute. Essentially it is same as DirectAppOnlyLaunchStrategy, but this requires user action/click.

UniversalLinkAppLaunchStrategy (Introduced on iOS9).

This is new deep linking technique introduced on IOS9. Same http url is used to open app or in browser. If app is installed and configured to work with universal link, then automatically opens the app from browser, ios message app and other apps. For this to work: 1. Website should have valid Universal Link(json file in root of website, apple-app-site-association) which defines path that will be used for universal linking. Eg /deeplink/*, * 2. App should be specify the domains that can be used for universal linking to the app. Eg. https://www.linkedin.com, https://www.twitter.com. While app is installing it invokes the Universal link present on the domain specified and registers those path for universal linking.

This technique will just change the url of 'Open In App' button, to the url that does universal linking.

To test if, universal linking is working for iOS App, tap the universal link from message app on Ios. If it does not open the app, then it means universal link is not configured properly.

Important: This is only being used on iOS9 Facebook browser. For this to work, landing page which is used for deeplinking should be cross domain. Otherwise it won't work. To get it working with Facebook and iOS9 directly, Facebook applink method can also be used, but it also requires some implementation on the App side.

NotSupportedAppLaunchStrategy.

This implementation displays browser dialog box with message provided in settings. Some of the browsers in Android Device does not understand Intent or Custom URI Scheme myapp://.

iOS

OS/Browser Facebook Twitter Chrome Safari
Version <= 8 DirectAppLaunchStrategy DirectAppLaunchStrategy DirectAppLaunchStrategy DirectAppLaunchStrategy
Version >= 9 UniversalLinkAppLaunchStrategy DirectAppLaunchStrategy DirectAppLaunchStrategy DirectAppLaunchStrategy

Android

OS/Browser Facebook Twitter Chrome Safari Stock Native
Version >= 4.3 CTAAppLaunchStrategy CTAAppLaunchStrategy CTAAppLaunchStrategy CTAAppLaunchStrategy NotSupportedAppLaunchStrategy NotSupportedAppLaunchStrategy
I have not tested it on < Android 4.3. But if it needs to be supported, create an issue or send a pull request.

Desktop

Does Nothing!!!

Usage (Requires Jquery)

$(document).ready(function() {
    NativeAppLauncher.init({
        appLauncherElId: 'open-app-link', // Element Id of App Launcher button. 
        notSupportedMessage: 'Sorry, you’ll need to use a different browser to do this.', // Defaults to 'Not Supported!'
        universalLinkUrl: 'http://mysite.com',
        appUri: 'myapp://',
        androidAppId: 'com.mycompany.app.enterprise',
        iOsAppStore: 'https://itunes.apple.com/app/apple-store/id234234234?pt=12121212&mt=8',
        debug: false, // Optional
        campaignCode: 'this-is-test-campaign' // optional, this appends campaign on app store url.
    });
});

deeplinkingtonativeapp's People

Contributors

coliff avatar diegocr avatar francislavoie avatar prabeengiri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

deeplinkingtonativeapp's Issues

Wordpress button to app

Hi Everyone,

I have a running wordpress website.
I am intending to create a button on a page, which when they click, it will open up a specific app on my app.
Is it possible to do that?

Use without jQuery in Angular and React webapps

Thank you for this great plugi. I am opening this issue to ask if it's possible to improve it so that it doesn't depend on jQuery and we can use it alongside with Angular and React webapps. Thanks.

iOS opening app on page load

Hello. I need to open the iOS app on button click but it opens on the page load. Android works fine. I am using the standard code form your example, i just modified my app parameters.

m value is not evaluated

Hello, when using the minify version provided with the example, apparently, m value is not evaluated.
An example of the resulting intent is : dat=syxgameet://matchDetail/?id=297://m/

This deeplink is generated from here : http://www.gameet.eu/match/detail.php?id=287

Problem appears on android, in standalone Chrome, and chrome webview from Gmail app.

Regards,

Xavier

Alternative for iOS Facebook?

So this project is super cool, planning on using it. Problem is, I can't actually set up Universal Links in my use-case because my customers are supposed to install our solution on-prem (self-hosted) and I can't predict which domains it will be used with, since they use their own domains. It seems to me the only use-case that would work for me because of this is iOS Facebook. Is there any alternative I could use in that case that doesn't depend on a domain?

Thanks!

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.