Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Other platform" configuration in Firebase dynamic links

When creating a dynamic link manually there is a ofl parameter for "other platforms". It handles this use case:

The link to open on platforms beside Android and iOS. This is useful to specify a different behavior on desktop, like displaying a full web page of the app content/payload (as specified by param link) with another dynamic link to install the app.

However when using the shortLinks API directly all the other configuration is present except the other platform configuration (and iOS minimum version parameter).

Is this just an oversight in the documentation, or is there no way to specify this parameter in the shortLinks endpoint. Must I create a long link manually and then shorten it?

like image 782
Samuel Avatar asked Dec 10 '25 02:12

Samuel


1 Answers

The only easy way I found in order to have the OFL params is by:

  1. Create a long link with all your params
  2. Append &ofl=[YOUR_LINK] at the end of the link
  3. Create a short link with the long link

Here is an example:

  const link = [YOUR_LINK];
  const domainUriPrefix = [YOUR_DOMAIN_URI_PREFIX];
  const ios = [YOUR_IOS_PARAMS];
  const android = [YOUR_ANDROID_PARAMS];
  const social = [YOUR_SOCIAL_PARAMS];
  let uncompressURL = await dynamicLinks().buildLink({
    link,
    domainUriPrefix,
    ios,
    android,
    social
  });
  uncompressURL += "&ofl=[YOUR_OFL_LINK]";
  let compressURL = await dynamicLinks().buildShortLink({
    link: uncompressURL,
    domainUriPrefix,
  });

The downside of this solution is that you have two redirection instead of one...

like image 190
Etienne Thibault Avatar answered Dec 12 '25 01:12

Etienne Thibault



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!