originalURL
TypeScriptget originalURL(): stringSwift declarationnonisolated var originalURL: URL { get set }The original URL of the metadata request.
struct · iOS 26.4+ · SDK 27.1
nonisolated struct LinkMetadataA structure containing metadata about a URL. Use ``LinkMetadata`` to store metadata about a URL, including its title, icon, images, and video. Fetch metadata using ``LPMetadataProvider``. For remote URLs, cache the metadata locally to avoid the data and performance cost of fetching it from the internet every time you present it. ``LinkMetadata`` is also serializable and conforms to ``Codable``.
get originalURL(): stringSwift declarationnonisolated var originalURL: URL { get set }The original URL of the metadata request.
set originalURL(value: string)Swift declarationnonisolated var originalURL: URL { get set }The original URL of the metadata request.
get remoteVideo(): (string) | nullSwift declarationnonisolated var remoteVideo: URL? { get set }A remote URL corresponding to a representative video for the URL
set remoteVideo(value: (string) | null)Swift declarationnonisolated var remoteVideo: URL? { get set }A remote URL corresponding to a representative video for the URL
get url(): stringSwift declarationnonisolated var url: URL { get set }The URL that returned the metadata, taking server-side redirects into account. The URL that returns the metadata may differ from the ``LinkMetadata/originalURL`` to which you sent the metadata request. This can happen if the server redirects the request, for example, when a resource has moved, or when the original URL is a domain alias.
set url(value: string)Swift declarationnonisolated var url: URL { get set }The URL that returned the metadata, taking server-side redirects into account. The URL that returns the metadata may differ from the ``LinkMetadata/originalURL`` to which you sent the metadata request. This can happen if the server redirects the request, for example, when a resource has moved, or when the original URL is a domain alias.
static initUrl(url: string): LinkMetadataSwift declarationnonisolated init(url: URL)Creates a new ``LinkMetadata`` value for the specified URL. - Parameter url: The URL that the metadata is for.
get title(): (string) | nullSwift declarationnonisolated var title: String? { get set }A representative title for the URL.
set title(value: (string) | null)Swift declarationnonisolated var title: String? { get set }A representative title for the URL.
static initFetchingTimeoutIncludeSubresources(request: _Foundation_URLRequest, timeout?: SDKHandle, includeSubresources?: boolean): Promise<LinkMetadata>Swift declarationnonisolated init(fetching request: URLRequest, timeout: Duration = .seconds(30), includeSubresources: Bool = true) async throwsCreates a ``LinkMetadata`` value from the specified properties by fetching the URL using the specified request. Metadata fetching supports Task cancellation; if the enclosing Task is cancelled, the metadata request will be cancelled. - Parameters: - request: The URL request to fetch the metadata from. - timeout: The time interval after which the request automatically fails if it hasn’t already completed. By default, this is 30 seconds. If a metadata fetch takes longer than the timeout interval, an ``Error`` is thrown. - includeSubresources: Determines if subresources should be fetched in addition to the main resource. If `true`, additional data will be fetched from the network to provide subresources such as images and icons. If `false`, no additional networking is done.
static initFetchingTimeoutIncludeSubresources27880(url: string, timeout?: SDKHandle, includeSubresources?: boolean): Promise<LinkMetadata>Swift declarationnonisolated init(fetching url: URL, timeout: Duration = .seconds(30), includeSubresources: Bool = true) async throwsCreates a ``LinkMetadata`` value from the specified properties by fetching the specified URL. Metadata fetching supports Task cancellation; if the enclosing Task is cancelled, the metadata request will be cancelled. - Parameters: - url: The URL to fetch the metadata from. - timeout: The time interval after which the request automatically fails if it hasn’t already completed. By default, this is 30 seconds. If a metadata fetch takes longer than the timeout interval, an ``Error`` is thrown. - includeSubresources: Determines if subresources should be fetched in addition to the main resource. If `true`, additional data will be fetched from the network to provide subresources such as images and icons. If `false`, no additional networking is done.
static init(metadata: LPLinkMetadata): (LinkMetadata) | nullSwift declarationnonisolated init?(_ metadata: sending LPLinkMetadata)Creates a ``LinkMetadata`` value from a ``LPLinkMetadata`` instance. - Parameter metadata: The `LPLinkMetadata` instance to convert from.
4 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
LinkMetadata.media(_:as:)
The iOS SDK compiler rejected this binding: cannot find type 'CoreTransferable' in scope
LinkMetadata.containsMedia(_:exportableAs:)
Passing a Swift type itself is not supported.
LinkMetadata.setMedia(_:for:)
This protocol needs associated types that cannot yet cross the bridge.
LinkMetadata.transferRepresentation
This protocol needs associated types that cannot yet cross the bridge.