fetchData(forBundleIdentifier:itemIdentifier:contentType:completionHandler:)
Fetches data from an external provider.
Declaration
func fetchData(forBundleIdentifier bundleIdentifier: String, itemIdentifier: String, contentType: UTType, completionHandler: @escaping @Sendable (Data?, (any Error)?) -> Void)func fetchData(forBundleIdentifier bundleIdentifier: String, itemIdentifier: String, contentType: UTType) async throws -> DataParameters
- bundleIdentifier:
The bundle identifier of the app to search.
- itemIdentifier:
The app-specific identifier of the item you want.
- contentType:
The type of data to fetch.
- completionHandler:
The block to execute with the results. The block has no return value and takes the following parameters:
- data
The data for the specified item, if successful.
- error
An error object, or
nilif the method retrieved the data successfully.
Discussion
Clients with the appropriate entitlements can use this method to fetch data from an external app such as Mail.