Skip to main content

🦋 Handle Dynamic Links in Unity

Enable your unity app to receive and handle ChottuLinks seamlessly. This allows users to open specific screens when they tap a dynamic link, whether the app is running, in the background, or launched from a cold start. Integrate link handling to ensure a smooth and context-aware user experience across platforms.

🛠 Prerequisites

  1. Configure ChottuLink Dashboard
    • Set up your project
    • Configure Android Or iOS app settings respectively
    • Get your API key
  2. Install ChottuLink Unity SDK
  3. Initialize ChottuLink Unity SDK

🔧 Implementation Guide

/// 🔗 Listen for incoming dynamic links
ChottuLink.OnLinkReceived += link => {
Debug.Log(" ✅ Link Received: "+link);
/// Tip: ➡️ Navigate to a specific page or take action based on the link
};

URL Processing

Advanced

Process the shortened Deeplink using the GetAppLinkDataFromUrl method.
This retrieves the associated app link data and returns a ResolvedLink object containing the resolved destination URL and the original short link.

📝 Method Signature

 public static void GetAppLinkDataFromUrl(
string shortUrl,
Action<ResolvedLink> onSuccess,
Action<string> onError
);
📥 Parameters
ParameterTypeRequiredDescription
shortUrlString✅ YesThe shortened URL string to be resolved
onSuccessAction<ResolvedLink> onSuccessNoCalled on successful link resolve
onErrorAction<string> onErrorNoCalled if link resolve fails
📤 Return Value

A ResolvedLink object containing:

public class ResolvedLink {
public string link;
public string shortLink;
}

💻 Basic Implementation

ChottuLink.GetAppLinkDataFromUrl(link, resolvedLink => {
Debug.Log("✅ Link: "+resolvedLink.link);
Debug.Log("✅ Short Link: "+resolvedLink.shortLink);
}, error => {
Debug.Log("❌ Error: "+error);
});

🎯 Use Cases

  • Manual Link Processing: Process links from user input
  • Testing: Test deep link functionality
  • Background Processing: Process links in background tasks
  • Link Validation: Validate links before processing