Callbacks: Tracking the Shoot Lifecycle
Implement the SpyneShootDelegate protocol in your view controller to handle shoot events
1. Common Parameters
All the callbacks (onShootInitiated, onShootCompleted, and onShootExit) use the following parameters:
Parameter | Type | Description |
---|---|---|
shootData | Object | Contains details about the shoot (e.g., vehicle VIN, stock number, registration number). |
dealerVinId | String | Unique identifier for the inventory record created for this shoot. |
mediaId | String | Unique identifier for the shoot session (used to track media files). |
2. Callbacks:
2.1. Shoot Initiated
This callback is triggered when the shoot process starts. It provides the initial details about the shoot, including the status, inventory ID, and media ID.
Code Example:
func shootDidInitiate(
shootData: ShootData,
dealerVinId: String,
mediaId: String,
status: String
) {
print("shootDidInitiate \(shootData) \(dealerVinId) \(mediaId) \(status)")
}
Description:
- shootData: Contains all the details of the shoot (e.g., vehicle identifiers, shoot configuration).
- inventoryId: The ID for the inventory record created for this shoot in Spyne's system.
- mediaId: Another unique ID that is created in the Spyne's sytem, mainly refers to the set the media files.
- status: The status of the shoot (e.g., “Draft”, “In Progress”).
2.2. Shoot Completed
This callback is triggered when the shoot has finished. It provides details about the shoot, including whether it is a reshoot of a previous session.
Code Example:
func shootDidComplete(
shootData: ShootData,
dealerVinId: String,
mediaId: String,
isReshoot: Bool
) {
print("shootDidComplete \(shootData) \(dealerVinId) \(mediaId) \(isReshoot)")
}
Description:
- shootData: Contains all the details of the shoot (e.g., vehicle identifiers, shoot configuration).
- inventoryId: The ID for the inventory record created for this shoot in Spyne's system.
- mediaId: Another unique ID that is created in the Spyne's sytem, mainly refers to the set the media files.
- isReshoot: A boolean flag indicating whether this shoot is a reshoot (true) or a new shoot (false).
2.3. Shoot Exit
This callback is triggered when the shoot process is exited. It is useful for capturing when the user or system leaves the shoot process prematurely, either due to a manual exit or an error.
Code Example:
func shootDidExit(
shootData: ShootData,
dealerVinId: String,
mediaId: String
) {
print("shootDidExit \(shootData) \(dealerVinId) \(mediaId)")
}
Description:
- shootData: Contains all the details of the shoot (e.g., vehicle identifiers, shoot configuration).
- inventoryId: The ID for the inventory record created for this shoot in Spyne's system.
- mediaId: Another unique ID that is created in the Spyne's sytem, mainly refers to the set the media files.
3. Receiving the processed media
When processing completes, you can retrieve output via our Webhook or GET API. Use the inventoryId from callbacks to match results.
inventoryId is known as dealerVinId in the API/webhook ecosystem.
→ View Retrieve Transformed Media for setup, payloads and examples.
Heads up: configure your webhook endpoint before going live. If you don’t use webhooks, you can poll the GET API with inventoryId/dealerVinId.
Key Takeaways
- shootData, inventoryId, and mediaId are shared across all three callbacks (onShootInitiated, onShootCompleted, and onShootExit).
- Shoot Initiated: Fired when the shoot starts, logging the shoot’s status and initial details.
- Shoot Completed: Fired when the shoot finishes, including whether it’s a reshoot.
- Shoot Exit: Fired when the shoot is exited, either manually or due to an error.
Updated 8 days ago