We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Apple Watch Device I've Network errors and the image is not loaded:
2023-05-05 12:02:52.574064+0200 Pin Vision Watch App[423:14134] Error getting network data status Error Domain=NSPOSIXErrorDomain Code=19 "Operation not supported by device" 2023-05-05 12:02:52.574407+0200 Pin Vision Watch App[423:14134] Task <C1C21836-E556-4D68-B493-977A1D301FB5>.<0> HTTP load failed, 0/0 bytes (error code: -1009 [1:50]) 2023-05-05 12:02:52.574955+0200 Pin Vision Watch App[423:14131] NSURLConnection finished with error - code -1009
In simulator the image is loaded correctly without errors.
How can I load map images directly in Device? Thanks!
The text was updated successfully, but these errors were encountered:
The code used is:
let snapshot = Snapshot(options: options, accessToken: Self.token) let image = snapshot.image
Sorry, something went wrong.
I found the issue.
The code is wrong on WatchOS:
Snapshot.swift line 174
@objc open var image: Image? { if let data = try? Data(contentsOf: url) { return Image(data: data) } else { return nil } }
Loading directly from Data is not allowed. You need to use URLSession instead.
Extend Class Snapshot and implement new method using URLSession like:
extension Snapshot { func getImage() async throws -> UIImage? { let (data, _) = try await URLSession.shared.data(from: url) return UIImage(data: data) } }
No branches or pull requests
On Apple Watch Device I've Network errors and the image is not loaded:
In simulator the image is loaded correctly without errors.
How can I load map images directly in Device?
Thanks!
The text was updated successfully, but these errors were encountered: