AppPanel
Durable LinksiOS Setup

Generating Durable Links

Build and shorten Durable Links using the iOS SDK.

Use DurableLinkComponents to build a link with all the parameters you need, then shorten it via the API.

Basic example

import AppPanel

guard let link = URL(string: "https://yourapp.com/product/123"),
      var components = AppPanel.shared.durableLinks.components(
        link: link,
        domainURIPrefix: "https://links.yourapp.com"
      ) else { return }

// iOS parameters
components.iOSParameters = DurableLinkComponents.IOSParameters(bundleID: "com.yourcompany.yourapp")
components.iOSParameters?.appStoreID = "123456789"
components.iOSParameters?.minimumAppVersion = "1.0.0"

// Android parameters
components.androidParameters = DurableLinkComponents.AndroidParameters(packageName: "com.yourcompany.yourapp")

// UTM tracking
components.analyticsParameters = DurableLinkComponents.AnalyticsParameters(
  source: "email",
  medium: "newsletter",
  campaign: "spring_sale"
)

// Social preview
components.socialMetaTagParameters = DurableLinkComponents.SocialMetaTagParameters(
  title: "Check out this product",
  descriptionText: "50% off for a limited time",
  imageURL: URL(string: "https://yourapp.com/images/product.jpg")
)
components.shorten(.short) { url, error in
  guard let shortURL = url else {
    print("Error: \(error?.localizedDescription ?? "unknown")")
    return
  }
  // https://links.yourapp.com/abc123
  print(shortURL)
}

The suffix option controls the short link suffix:

OptionDescription
.shortShort, readable suffix (e.g. abc123)
.unguessableLonger, random suffix that can't be guessed

The link parameter must be a valid HTTP or HTTPS URL and cannot be another Durable Link.

Parameter reference

IOSParameters

PropertyTypeDescription
bundleIDStringThe bundle ID of your iOS app (required)
appStoreIDString?Your app's App Store ID, used to send users to the App Store when the app isn't installed
fallbackURLURL?URL to open if the app is not installed
customSchemeString?A custom URL scheme, if different from the bundle ID
iPadBundleIDString?A separate bundle ID for iPad, if different from iPhone
iPadFallbackURLURL?Fallback URL for iPad if the iPad app is not installed
minimumAppVersionString?Minimum app version required to open the link

AndroidParameters

PropertyTypeDescription
packageNameStringThe Android package name (required)
fallbackURLURL?URL to open if the app is not installed
minimumVersionIntMinimum version code of the Android app required to open the link

AnalyticsParameters

PropertyTypeDescription
sourceString?UTM source (e.g. email)
mediumString?UTM medium (e.g. newsletter)
campaignString?UTM campaign (e.g. spring_sale)
termString?UTM term
contentString?UTM content

SocialMetaTagParameters

PropertyTypeDescription
titleString?Title for social link previews
descriptionTextString?Description for social link previews
imageURLURL?Image URL for social link previews
PropertyTypeDescription
forcedRedirectEnabledBoolWhen true, skip the app preview page and redirect directly

OtherPlatformParameters

PropertyTypeDescription
fallbackURLURL?URL to open on desktop or other platforms

On this page