Firebase Dynamic Links Plugin

This plugin allows you create short or long Dynamic Links with the Firebase Dynamic Links for iOS(8+) and Android(5.0 +)

Functions:

firebaseDynamicLinks.init()

-- initialize firebase dynamic links

firebaseDynamicLinks.shortenURL(url, listener) --used to generate shorten Dynamic Link URL

url(string) url to shorten

listener (function) --returned values

  • event.url(string)
  • event.isError(boolean)
  • event.error(string)

firebaseDynamicLinks.buildUrl(params) --returns a url with params

params(table) -- params to pass in

  • domain = string, (required) Your Dynamic Link URL prefix, which you can find in the Firebase console. A Dynamic Link domain looks like the following examples: https://example.com/link https://example.page.link
  • link = string, (required) The link your app will open. Specify a URL that your app can handle, typically the app's content or payload, which initiates app-specific logic
  • --iOS Params
  • iOSBundleID = string, (required for passing in iOS specific params) your app bundle id example: com.example.ios
  • iOSAppStoreID = string, Your app's App Store ID, used to send users to the App Store when the app isn't installed
  • iOSCustomScheme = string, Your app's custom URL scheme, if defined to be something other than your app's bundle ID
  • iOSFallbackURL = string, The link to open when the app isn't installed. Specify this to do something other than install your app from the App Store when the app isn't installed, such as open the mobile web version of the content, or display a promotional page for your app
  • iPadBundleID = string, The bundle ID of the iOS app to use on iPads to open the link. The app must be connected to your project from the Overview page of the Firebase console.
  • iPadFallbackURL = string, The link to open on iPads when the app isn't installed. Specify this to do something other than install your app from the App Store when the app isn't installed, such as open the web version of the content, or display a promotional page for your app.
  • iOSMinimumAppVersion = string, The version number of the minimum version of your app that can open the link. This flag is passed to your app when it is opened, and your app must decide what to do with it.
  • --Android Params
  • androidPackageName = string, Android Package Name for linking
  • androidMinimumAppVersion = string, The versionCode of the minimum version of your app that can open the link. If the installed app is an older version, the user is taken to the Play Store to upgrade the app.
  • androidFallbackURL = string, The link to open when the app isn't installed. Specify this to do something other than install your app from the Play Store when the app isn't installed, such as open the mobile web version of the content, or display a promotional page for your app
  • --Analytics Params
  • analyticsCampaign = string
  • analyticsMedium = string
  • analyticsSource = string
  • analyticsTerm = string
  • analyticsContent = string
  • --iTunesConnect Params
  • iTunesConnectAffiliateToken = string
  • iTunesConnectCampaignToken = string
  • iTunesConnectProviderToken = string
  • --SocialMetaTag Params
  • socialMetaTagTitle = string, the title to use when the Dynamic Link is shared in a social post
  • socialMetaTagDescriptionText = string, the description to use when the Dynamic Link is shared in a social post
  • socialMetaTagImageURL = string, the URL to an image related to this link. The image should be at least 300x200 px, and less than 300 KB
  • --Other Params
  • navigationInfoForcedRedirectEnabled = boolean, if true skip the app preview page when the Dynamic Link is opened, and instead redirect to the app or store. The app preview page (enabled by default) can more reliably send users to the most appropriate destination when they open Dynamic Links in apps
  • otherPlatformFallbackUrl = string, fallback url

Runtime Events:

  • event.name = "firebaseDynamicLinks"
  • event.url(string)
  • event.minimumAppVersion(string)
  • event.matchType(string) "none", "weak","unique", or "default"

Setup:

Make sure you download and include GoogleServices-Info.plist and put in root folder of corona project. Also add your google-services.json to your root folder and useGoogleServicesJson = true in build.settings. Also add google_app_id(App ID) string to android section (see example below)

Common Mistakes:

If you get a page with "Invalid Dynamic Link" make sure the "link" you specify is in you domains "Allowlist URL pattern" i.e "https://example.com" or "^https://example.com.*$" (allows subpages)

Using a custom domain see this link

Helpful Links:

Get Plugin

Example

Support