Giter Site home page Giter Site logo

hathway / cordova-plugin-firebase-dynamiclinks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chemerisuk/cordova-plugin-firebase-dynamiclinks

0.0 1.0 1.0 65 KB

Cordova plugin for Firebase Dynamic Links

Java 42.87% Objective-C 52.79% JavaScript 4.34%

cordova-plugin-firebase-dynamiclinks's Introduction

Cordova plugin for Firebase Dynamic Links

NPM version NPM downloads NPM total downloads PayPal donate Twitter

Index

Supported Platforms

  • iOS
  • Android

Installation

$ cordova plugin add cordova-plugin-firebase-dynamiclinks --variable APP_DOMAIN_NAME="mydomain.page.link"

Use variable APP_DOMAIN_NAME to specify your Google generated *.page.link domain or other custom domain.

$ cordova plugin add cordova-plugin-firebase-dynamiclinks --variable APP_DOMAIN_NAME="mydomain.com" --variable APP_DOMAIN_PATH="/app1"

Use variables APP_DOMAIN_PATH to speciy a specific domain path prefix when using a custom domain. This is useful if multiple apps share the same root level domain. If specified this path must begin with a /.

Use variables IOS_FIREBASE_DYNAMICLINKS_VERSION and ANDROID_FIREBASE_DYNAMICLINKS_VERSION to override dependency versions for Firebase SDKs.

Quirks

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

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

To get callback for new app installs on iOS your dynamic link MUST have an app preview page, which is by default.

Methods

getDynamicLink

Determines if the app has a pending dynamic link and provide access to the dynamic link parameters.

cordova.plugins.firebase.dynamiclinks.getDynamicLink().then(function(data) {
    if (data) {
        console.log("Read dynamic link data on app start:", data);
    } else {
        console.log("App wasn't started from a dynamic link");
    }
});

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

chemerisuk avatar mcfarljw avatar misterwell avatar

Watchers

 avatar

Forkers

michel

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.