Data Types
This page documents all shared data types used across the OpenLynk SDKs. Each type is shown with its field names and types for every supported platform.
CreatedLink
Returned by createLink() in all SDKs.
| Field | Flutter (Dart) | iOS (Swift) | Android (Kotlin) | Android (Java) | Description |
|---|---|---|---|---|---|
id | String | String | String | String | Unique link ID (UUID) |
slug | String | String | String | String | URL slug (e.g., abc123) |
url | String | String | String | String | Full shareable URL |
destination | String | String | String | String | The destination path provided when creating the link |
metadata | Map<String, dynamic> | [String: Any] | Map<String, Any> | Map<String, Object> | All metadata including system-generated fields |
Example:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"slug": "abc123",
"url": "https://myapp.openlynk.to/abc123",
"destination": "/product/123?ref=share",
"metadata": {
"campaign": "summer-sale",
"destination_path": "/product/123",
"destination_full": "/product/123?ref=share",
"created_via": "sdk"
}
}
ParsedDeepLink
Passed to the onDeepLink callback when a deep link opens the app.
| Field | Flutter (Dart) | iOS (Swift) | Android (Kotlin/Java) | Description |
|---|---|---|---|---|
originalUri / originalURL | Uri | URL | Uri | The URL that opened the app |
destination | String | String | String | Full destination with query parameters |
destinationPath | String | String | String | Path only (e.g., /product/123) |
parameters | Map<String, dynamic> | [String: Any] | Map<String, Any> | Custom metadata (excluding internal fields) |
metadata | Map<String, dynamic> | [String: Any] | Map<String, Any> | Full metadata object including system fields |
linkId | String | String | String | OpenLynk link ID |
slug | String | String | String | URL slug |
:::tip parameters vs metadata
Use parameters when you only need the custom metadata you attached when creating the link. Use metadata when you need access to system-generated fields like destination_path, destination_full, and created_via.
:::
RestoredLink
Passed to the onRestoredLinks callback when deferred links are restored after app installation.
| Field | Flutter (Dart) | iOS (Swift) | Android (Kotlin/Java) | Description |
|---|---|---|---|---|
pendingLinkId | String | String | String | ID of the pending link record |
originalUrl | String | String | String | URL the user originally clicked |
destinationUrl | String | String | String | Destination URL |
destinationPath | String? | String? | String? | Path only (e.g., /product/123) |
destination | String? | String? | String? | Full destination with parameters |
parameters | Map<String, dynamic>? | [String: Any]? | Map<String, Any>? | Custom metadata for easy access |
metadata | Map<String, dynamic> | [String: Any] | Map<String, Any> | Full metadata object |
linkId | String | String | String | Original link ID |
Flutter-Only UTM Getters
The Flutter SDK provides convenience getters on RestoredLink for UTM parameters:
| Getter | Type | Description |
|---|---|---|
utmSource | String? | Value of utm_source from metadata |
utmCampaign | String? | Value of utm_campaign from metadata |
utmMedium | String? | Value of utm_medium from metadata |
utmTerm | String? | Value of utm_term from metadata |
utmContent | String? | Value of utm_content from metadata |
On other platforms, access UTM parameters directly from the metadata map.
LinkDetails
Returned by getLinkBySlug() in all SDKs.
| Field | Flutter (Dart) | iOS (Swift) | Android (Kotlin/Java) | Description |
|---|---|---|---|---|
id | String | String | String | Link ID |
slug | String | String | String | URL slug |
destinationWebUrl | String | String | String | Web fallback URL |
destinationPath | String | String | String | Path only (e.g., /product/123) |
destination | String | String | String | Full destination with parameters |
parameters | Map<String, dynamic> | [String: Any] | Map<String, Any> | Extracted custom parameters |
metadata | Map<String, dynamic> | [String: Any] | Map<String, Any> | Full metadata object |
What's Next?
- See the Flutter SDK Reference for how these types are used in Dart
- See the iOS SDK Reference for Swift-specific usage
- See the Android (Kotlin) SDK Reference or Android (Java) SDK Reference for Android usage
- Learn about deep linking concepts to understand how metadata flows through the system