You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/HVCaptureSDK/HVCaptureSDK.docc/GettingStarted.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ The SDK should be initialized as early as possible in the app lifecycle. This is
25
25
As such, the SDK should (ideally) be initialized in host application’s `applicationDidFinishLaunching` method, so that the SDK can continue uploading any files that remain to be uploaded. This helps expedite 3D model generation, as we need all the captured images and metadata to begin the 3D reconstruction process.
@@ -36,7 +36,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
36
36
}
37
37
```
38
38
39
-
While running this in `applicationDidFinishLaunching` would be ideal, at a minimum it should be run at some point prior to starting a capture session.
39
+
While running this in `applicationDidFinishLaunching` would be ideal, at a minimum it should be run at some point prior to starting a capture session.
40
40
41
41
NOTE: if background uploads are both enabled and wanted, the application should call `HVPartnerSDK.sharedInstance.registerForBackgroundJobs()` before the app completes launching. See the section on [Supporting Background Uploads](#supporting-background-uploads) for further details.
Since the capture flow proceeds asynchronously, the host app may want to monitor the local job status as the capture proceeds. There are a few methods for obtaining Job status:
109
109
110
-
1. on-demand: The ``HVPartnerSDK`` class exposes a public method ``HVPartnerSDK/getClientJobStatus(for:)``. This is an `async` method that will return what the requested `Job`'s current status as a ``JobStatus``. If the requested ``Job`` doesn't exist locally, then it will raise a ``HVJobError`` exception.
110
+
1. on-demand: The ``HVPartnerSDK`` class exposes a public method ``HVPartnerSDK/getClientJobStatus(for:)``. This is an `async` method that will return what the requested `Job`'s current status as a ``JobStatus``. If the requested ``Job`` doesn't exist locally, then it will raise a ``HVJobError`` exception.
111
111
2. streaming: The ``HVPartnerSDK`` class also exposes a public method ``HVPartnerSDK/getJobStateObservable(for:)`` that returns a `Combine` publisher for the requested `Job`. The publisher will emit ``JobStatus`` instances whenever there's a change in the `Job`'s status. Additionally, `startCaptureSession` will return what the current `Job`'s status is when called, so together with `getJobStateObservable` you can track the whole status history for the `Job` (n.b. the initial state won't be published for a `Job`, so to get the complete status history you need to use the initial state returned from ``HVPartnerSDK/startCaptureSession(settings:info:)`` in conjunction with the publisher from `getJobStateObservable`). The initial Job state will generally be ``JobStatus.Created`` if newly created, or ``JobStatus.Draft`` if resuming an existing Job.
112
112
113
113
For example, adapting the previous example to monitor the `Job` status and build a complete `JobStatus` history for the capture session, you can do:
114
114
115
115
```swift
116
-
importHVCaptureSDK
117
-
importSwiftUI
118
116
importCombine
117
+
importSwiftUI
118
+
importHVCaptureSDK
119
119
120
120
structFooView: View {
121
121
let jobInfo: CaptureJobInformation
@@ -137,14 +137,14 @@ struct FooView: View {
137
137
if jobCancellables[jobInfo.identifier] ==nil {
138
138
let cancellable = HVPartnerSDK.sharedInstance.getJobStateObservable(for: jobInfo.identifier).sink(receiveValue: { (jobState: JobStatus) in
139
139
// NOTE: you can take various actions here based on the status change
@@ -192,4 +192,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
192
192
193
193
> Warning: Since we use `BGTaskScheduler` for our background processing, we need to call ``HVPartnerSDK/registerForBackgroundJobs()`` **before** the application finishes launching. If not, then the application will raise an `NSInternalInconsistencyException` exception with the reason: `'All launch handlers must be registered before application finishes launching'`. This is a constraint imposed by the [BGTaskScheduler framework itself](https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler/register(fortaskwithidentifier:using:launchhandler:)#Discussion) and if ignored will likely crash the application.
194
194
195
-
While using `registerForBackgroundJobs` enables the SDK to schedule background tasks on its own as needed, it's also possible to disable automatic background task scheduling and have more manual control over background task scheduling. This can be useful for applications that want closer control over background tasks spawned from the SDK and which already have their own background task scheduling. This can be achieved by **not** calling ``HVPartnerSDK/registerForBackgroundJobs()``, and instead calling ``HVPartnerSDK/initializeForBackground(parameters:)`` from within a [BGProcessingTask](https://developer.apple.com/documentation/backgroundtasks/bgprocessingtask). Under the hood, this will check if there are pending uploads. If there are no pending uploads, then it will exit and do nothing. If there are, then it'll run asynchronously and attempt to complete the pending uploads, performing a single upload at a time and exiting once the pending upload queue has been completed.
195
+
While using `registerForBackgroundJobs` enables the SDK to schedule background tasks on its own as needed, it's also possible to disable automatic background task scheduling and have more manual control over background task scheduling. This can be useful for applications that want closer control over background tasks spawned from the SDK and which already have their own background task scheduling. This can be achieved by **not** calling ``HVPartnerSDK/registerForBackgroundJobs()``, and instead calling ``HVPartnerSDK/initializeForBackground(parameters:)`` from within a [BGProcessingTask](https://developer.apple.com/documentation/backgroundtasks/bgprocessingtask). Under the hood, this will check if there are pending uploads. If there are no pending uploads, then it will exit and do nothing. If there are, then it'll run asynchronously and attempt to complete the pending uploads, performing a single upload at a time and exiting once the pending upload queue has been completed.
Copy file name to clipboardExpand all lines: Sources/HVCaptureSDK/HVCaptureSDK.docc/Tutorials/HVThemeCustomization.tutorial
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@
66
66
@Step {
67
67
In this step, we specify some of the customizable icons.
68
68
The icon for the success screen is specified with ``HVTheme/hoverCaptureSuccessIcon``, set to `Image(systemName: "paperplane")` in this step. It's color is determined by the `hoverCaptureTutorialImageOverlayStroke` setting.
69
-
Applications can use arbitrary custom images by supplying them in the application bundle, downloading them from the internet at runtime, etc. We simply used system images here for simplicity's sake.
69
+
Applications can use arbitrary custom images by supplying them in the application bundle, downloading them from the internet at runtime, etc. We simply used system images here for simplicity's sake. Note however that we set the icon theme based on the theme, so `Image`s are rendered with [Image.renderingMode](https://developer.apple.com/documentation/swiftui/image/renderingmode(_:)) set to `.template`, so the original icon's color will be overridden by the corresponding theme color.
0 commit comments