Git Product home page Git Product logo

cordova-plugin-firebase-dynamiclinks's Introduction

Cordova plugin for Firebase Dynamic Links

NPM version NPM downloads Twitter

Donate Your help is appreciated. Create a PR, submit a bug or just grab me ๐Ÿบ

Index

Supported Platforms

  • iOS
  • Android

Installation

$ cordova plugin add cordova-plugin-firebase-dynamiclinks --variable APP_DOMAIN="example.com" --variable PAGE_LINK_DOMAIN="example.page.link"

Use variable APP_DOMAIN specify web URL where your app will start an activity to handle the link.

Use variable PAGE_LINK_DOMAIN specify your *.page.link domain.

Use variable FIREBASE_DYNAMIC_LINKS_VERSION and FIREBASE_ANALYTICS_VERSION to override dependency version on Android.

Quirks

On Android you have to add AndroidLaunchMode setting in order to prevent creating of multiple app activities:

<preference name="AndroidLaunchMode" value="singleTask" />

Firebase Dynamic Links SDK has an unresolved bug related to parsing deepLink for new app installs. In order to get it work your dynamic link MUST have an app preview page, which by default.

Methods

onDynamicLink(callback)

Registers callback that is triggered on each dynamic link click.

cordova.plugins.firebase.dynamiclinks.onDynamicLink(function(data) {
    console.log("Dynamic link click with data:", data);
});

Every create* method accepts dynamicLinkInfo object as the first argument. Read section below to understand all supported dynamic link parameters.

createDynamicLink(parameters)

Creates a Dynamic Link from the parameters. Returns a promise fulfilled with the new dynamic link url.

cordova.plugins.firebase.dynamiclinks.createDynamicLink({
    link: "https://google.com"
}).then(function(url) {
    console.log("Dynamic link was created:", url);
});

createShortDynamicLink(parameters)

Creates a shortened Dynamic Link from the parameters. Shorten the path to a string that is only as long as needed to be unique, with a minimum length of 4 characters. Use this method if sensitive information would not be exposed if a short Dynamic Link URL were guessed.

cordova.plugins.firebase.dynamiclinks.createShortDynamicLink({
    link: "https://google.com"
}).then(function(url) {
    console.log("Dynamic link was created:", url);
});

createUnguessableDynamicLink(parameters)

Creates a Dynamic Link from the parameters. Shorten the path to an unguessable string. Such strings are created by base62-encoding randomly generated 96-bit numbers, and consist of 17 alphanumeric characters. Use unguessable strings to prevent your Dynamic Links from being crawled, which can potentially expose sensitive information.

cordova.plugins.firebase.dynamiclinks.createUnguessableDynamicLink({
    link: "https://google.com"
}).then(function(url) {
    console.log("Dynamic link was created:", url);
});

Dynamic link parameters

Any create method supports all options below to customize a returned dynamic link. Parameter names has the same meaning as in the Firebase Dynamic Links Short Links API Reference:

{
  "domainUriPrefix": string,
  "link": string,
  "androidInfo": {
    "androidPackageName": string,
    "androidFallbackLink": string,
    "androidMinPackageVersionCode": number
  },
  "iosInfo": {
    "iosBundleId": string,
    "iosFallbackLink": string,
    "iosIpadFallbackLink": string,
    "iosIpadBundleId": string,
    "iosAppStoreId": string
  },
  "navigationInfo": {
    "enableForcedRedirect": boolean,
  },
  "analyticsInfo": {
    "googlePlayAnalytics": {
      "utmSource": string,
      "utmMedium": string,
      "utmCampaign": string,
      "utmTerm": string,
      "utmContent": string
    },
    "itunesConnectAnalytics": {
      "at": string,
      "ct": string,
      "pt": string
    }
  },
  "socialMetaTagInfo": {
    "socialTitle": string,
    "socialDescription": string,
    "socialImageLink": string
  }
}

cordova-plugin-firebase-dynamiclinks's People

Contributors

ahmedogela avatar chemerisuk avatar chuckv01 avatar

Watchers

 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.