18

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?

Samuel
  • 16,923
  • 6
  • 62
  • 75

1 Answers1

1

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...