Docs
grovs.io Start for free

Link creation

Generate smart links programmatically in your iOS app.

Create smart links from your app with generateLink, then share them.

Pass preview metadata, a payload and tracking parameters:

Swift
Grovs.generateLink(
    title: "Check out this product",
    subtitle: "Limited time offer",
    imageURL: "https://example.com/image.jpg",
    data: ["productId": "12345", "screen": "product_detail"],
    tags: ["promotion", "share"],
    customRedirects: nil,
    showPreviewiOS: true,
    showPreviewAndroid: nil,
    copyToClipboardiOS: nil,
    copyToClipboardAndroid: nil,
    trackingCampaign: "spring_sale",
    trackingSource: "in_app",
    trackingMedium: "share_button"
) { url in
    guard let url = url else { return }
    print("Generated link: \(url)")
}

Parameters

ParameterTypeDescription
titleString?Link preview title
subtitleString?Link preview subtitle
imageURLString?Link preview image URL
data[String: Any]?Custom payload delivered on deep link open
tags[String]?Tags for filtering and analytics
customRedirectsCustomRedirects?Override default redirect behavior
showPreviewiOSBool?Show link preview on iOS (uses dashboard default if nil)
showPreviewAndroidBool?Show link preview on Android (uses dashboard default if nil)
copyToClipboardiOSBool?Copy the link to the visitor's clipboard on the iOS preview page, for clipboard-assisted deferred deep linking (uses project default if nil)
copyToClipboardAndroidBool?Same, for the Android preview page (uses project default if nil)
trackingCampaignString?UTM campaign parameter
trackingSourceString?UTM source parameter
trackingMediumString?UTM medium parameter

Custom redirects

CustomRedirects overrides where a link sends users on each platform:

Swift
let redirects = CustomRedirects(
    ios: CustomLinkRedirect(link: "https://example.com/ios-promo"),
    android: CustomLinkRedirect(link: "https://example.com/android-promo"),
    desktop: CustomLinkRedirect(link: "https://example.com/desktop-promo", openAppIfInstalled: false)
)
 
Grovs.generateLink(
    title: "Special offer",
    data: ["promoId": "summer25"],
    customRedirects: redirects
) { url in
    guard let url = url else { return }
    print("Generated link: \(url)")
}

Each CustomLinkRedirect takes a link URL and an optional openAppIfInstalled flag (default true). With true, the app opens if installed. With false, the redirect URL is always used.

Present a share sheet once the link is ready:

Swift
Grovs.generateLink(
    title: "Share this",
    data: ["itemId": "abc"]
) { url in
    guard let url = url else { return }
    let activityVC = UIActivityViewController(activityItems: [url], applicationActivities: nil)
    self.present(activityVC, animated: true)
}
Last updated 2026-10-27
Was this page helpful?