8.0.0 • Published 6 months ago

cordova-plugin-firebase-dynamiclinks v8.0.0

Weekly downloads
902
License
MIT
Repository
github
Last release
6 months ago

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_POD_VERSION and ANDROID_FIREBASE_BOM_VERSION to override dependency versions for Firebase SDKs:

$ cordova plugin add cordova-plugin-firebase-dynamiclinks \
--variable IOS_FIREBASE_POD_VERSION="9.3.0" \
--variable ANDROID_FIREBASE_BOM_VERSION="30.3.1"

Adding required configuration files

Cordova supports resource-file tag for easy copying resources files. Firebase SDK requires google-services.json on Android and GoogleService-Info.plist on iOS platforms.

  1. Put google-services.json and/or GoogleService-Info.plist into the root directory of your Cordova project
  2. Add new tag for Android platform
<platform name="android">
    ...
    <resource-file src="google-services.json" target="app/google-services.json" />
</platform>
...
<platform name="ios">
    ...
    <resource-file src="GoogleService-Info.plist" />
</platform>

Type Aliases

DynamicLinkAndroidInfo

DynamicLinkAndroidInfo: Object

Type declaration

NameTypeDescription
androidFallbackLinkstringLink to open when the app isn't installed.
androidMinPackageVersionCodenumberVersionCode of the minimum version of your app that can open the link.
androidPackageNamestringPackage name of the Android app to use to open the link.

DynamicLinkGoogleAnalyticsInfo

DynamicLinkGoogleAnalyticsInfo: Object

Type declaration

NameTypeDescription
utmCampaignstringCampaign name; The individual campaign name, slogan, promo code, etc. for a product.
utmContentstringCampaign content; used for A/B testing and content-targeted ads to differentiate ads or links that point to the same URL.
utmMediumstringCampaign medium; used to identify a medium such as email or cost-per-click (cpc).
utmSourcestringCampaign source; used to identify a search engine, newsletter, or other source.
utmTermstringCampaign term; used with paid search to supply the keywords for ads.

DynamicLinkIosInfo

DynamicLinkIosInfo: Object

Type declaration

NameTypeDescription
iosAppStoreIdstringApp Store ID, used to send users to the App Store when the app isn't installed.
iosBundleIdstringBundle ID of the iOS app to use to open the link.
iosFallbackLinkstringLink to open when the app isn't installed.
iosIpadBundleIdstringBundle ID of the iOS app to use on iPads to open the link.
iosIpadFallbackLinkstringLink to open on iPads when the app isn't installed.

DynamicLinkItunesAnalyticsInfo

DynamicLinkItunesAnalyticsInfo: Object

Type declaration

NameTypeDescription
atstringAffiliate token used to create affiliate-coded links.
ctstringCampaign token that developers can add to any link in order to track sales from a specific marketing campaign.
ptstringProvider token that enables analytics for Dynamic Links from within iTunes Connect.

DynamicLinkNavigationInfo

DynamicLinkNavigationInfo: Object

Type declaration

NameTypeDescription
enableForcedRedirectbooleanIf true, app preview page will be disabled and there will be a redirect to the FDL.

DynamicLinkOptions

DynamicLinkOptions: Object

Options when creating a dynamic link Parameter names has the same meaning as in the Firebase Dynamic Links Short Links API Reference

Type declaration

NameTypeDescription
androidInfo?DynamicLinkAndroidInfoAndroid parameters.
domainUriPrefix?stringDomain uri prefix to use for this Dynamic Link.
googlePlayAnalytics?DynamicLinkGoogleAnalyticsInfoGoogle Analytics parameters.
iosInfo?DynamicLinkIosInfoiOS parameters.
itunesConnectAnalytics?DynamicLinkItunesAnalyticsInfoiTunes Connect App Analytics parameters.
linkstringThe link your app will open.
navigationInfo?DynamicLinkNavigationInfoNavigation info parameters.
socialMetaTagInfo?DynamicLinkSocialInfoSocial meta-tag parameters.

DynamicLinkPayload

DynamicLinkPayload: Object

Type declaration

NameTypeDescription
clickTimestampnumberThe time that the user clicked on the dynamic link.
deepLinkstring | nullLink parameter of the dynamic link.
minimumAppVersion?numberThe minimum app version requested to process the dynamic link that can be compared directly with versionCode (Android only)

DynamicLinkSocialInfo

DynamicLinkSocialInfo: Object

Type declaration

NameTypeDescription
socialDescriptionstringDescription to use when the Dynamic Link is shared in a social post.
socialImageLinkstringURL to an image related to this link.
socialTitlestringTitle to use when the Dynamic Link is shared in a social post.

Functions

createDynamicLink

createDynamicLink(params): Promise<string>

Creates a Dynamic Link from the parameters.

Example

cordova.plugins.firebase.dynamiclinks.createDynamicLink({
    link: "https://google.com"
}).then(function(deepLink) {
    console.log("Generated deep link", deepLink);
});

Parameters

NameTypeDescription
paramsDynamicLinkOptionsParameters to use for building a link

Returns

Promise<string>

Fulfils promise with created link string


createShortDynamicLink

createShortDynamicLink(params): Promise<string>

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.

Example

cordova.plugins.firebase.dynamiclinks.createShortDynamicLink({
    link: "https://google.com"
}).then(function(deepLink) {
    console.log("Generated deep link", deepLink);
});

Parameters

NameTypeDescription
paramsDynamicLinkOptionsParameters to use for building a link

Returns

Promise<string>

Fulfils promise with created link string


createUnguessableDynamicLink

createUnguessableDynamicLink(params): Promise<string>

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.

Example

cordova.plugins.firebase.dynamiclinks.createUnguessableDynamicLink({
    link: "https://google.com"
}).then(function(deepLink) {
    console.log("Generated deep link", deepLink);
});

Parameters

NameTypeDescription
paramsDynamicLinkOptionsParameters to use for building a link

Returns

Promise<string>

Fulfils promise with created link string


getDynamicLink

getDynamicLink(): Promise<DynamicLinkPayload | null>

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

Example

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

Returns

Promise<DynamicLinkPayload | null>

Fulfils promise with dynamic link payload when it exists.


onDynamicLink

onDynamicLink(callback, errorCallback?): void

Registers callback that is triggered on each dynamic link click.

Example

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

Parameters

NameTypeDescription
callback(payload: DynamicLinkPayload) => voidCallback function
errorCallback?(error: string) => voidError callback function

Returns

void

8.0.0

6 months ago

7.0.0

2 years ago

7.0.2

2 years ago

7.0.1

2 years ago

6.1.2

2 years ago

6.1.1

3 years ago

6.1.3

2 years ago

6.1.0

3 years ago

6.0.1

3 years ago

6.0.0

3 years ago

5.0.0

3 years ago

4.8.0

4 years ago

4.7.0

4 years ago

4.6.0

4 years ago

4.5.1

4 years ago

4.5.0

4 years ago

4.4.0

4 years ago

4.3.0

4 years ago

4.2.0

4 years ago

4.1.0

4 years ago

4.0.3

4 years ago

4.0.2

4 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.0.0

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.14.0

6 years ago

0.13.2

6 years ago

0.13.1

6 years ago

0.13.0

6 years ago

0.12.1

6 years ago

0.12.0

6 years ago

0.11.0

7 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.6

7 years ago

0.9.5

7 years ago

0.9.4

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago