🦋 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
- Configure ChottuLink Dashboard
- Set up your project
- Configure Android Or iOS app settings respectively
- Get your API key
- Install ChottuLink Unity SDK
- 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
};
(Optional) Get AppLink Data from the Deeplink URL directly
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
| Parameter | Type | Required | Description |
|---|---|---|---|
shortUrl | String | ✅ Yes | The shortened URL string to be resolved |
onSuccess | Action<ResolvedLink> onSuccess | No | Called on successful link resolve |
onError | Action<string> onError | No | Called 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