Initiate a Shoot
This section explains how to:
- Start a new shoot for a vehicle.
- Resume an unfinished draft shoot.
- Initiate a reshoot for a completed or failed shoot.
We’ll first guide you through how to start a shoot, then dive into the vehicle matching logic and the reshoot process.
1. Key Terminology
To initiate a shoot for a vehicle, you’ll need to call the startShoot() method. This method requires the following key components:
1.1 ShootData
The ShootData object contains the details about the vehicle being shot. At least one of the following parameters in ShootData must be provided.
Field | Type | Required? | Description |
---|---|---|---|
vin | String? | ❌ | Vehicle Identification Number (VIN). Must be 17 characters if provided. |
stockNumber | String? | ❌ | Stock number of the vehicle as per your internal system. |
registrationNumber | String? | ❌ | Vehicle's registration number. |
At least one of vin, stockNumber, or registrationNumber must be provided.
1.2 UserData
The UserData object contains information about the user initiating the shoot.
Field | Type | Required? | Description |
---|---|---|---|
userId | String? | ❌ | A unique identifier for the user (e.g., email or system ID). |
1.3 Locale
The locale parameter specifies the language in which the shoot interface will be displayed. Refer to the link mentioned below to view the list of supported languages and their code.
Supported LanguagesThis ensures that the UI during the shoot reflects the preferred language for the user.
If no locale is provided, the SDK will default to "en" (English).
1.4 ShootEnvironment
Mode in which the SDK runs — Production for live shoots or Staging for testing.
2. Start a new shoot
To initiate a shoot, pass the context and a listener for the callback. The listener must be extended to handle various events during the shoot process.
For the listener you have to extend the "SpyneShootListener" class. Sample code for the same:
class YourActivity : AppCompatActivity(), SpyneAutomobileSDK.SpyneShootListener {
override fun onShootInitiated(
shootData: ShootData,
dealerVinId: String,
mediaId: String,
status: String
) {
Log.d(TAG, "New Callbacks: onShootInitiated ShootData $shootData \n dealerVinId $dealerVinId \n mediaId $mediaId \n status $status")
}
override fun onShootCompleted(
shootData: ShootData,
dealerVinId: String,
mediaId: String,
isReshoot: Boolean
) {
Log.d(TAG, "New Callbacks: onShootCompleted ShootData $shootData \n dealerVinId $dealerVinId \n mediaId $mediaId")
}
override fun onShootExit(
shootData: ShootData,
dealerVinId: String,
mediaId: String
) {
Log.d(TAG, "New Callbacks: onShootExit ShootData $shootData \n dealerVinId $dealerVinId \n mediaId $mediaId")
}
}
The following code demonstrates this setup:
val builder = SpyneAutomobileSDK.Builder(context = this, listener: SpyneShootListener)
.setEnvironment(ShootEnvironment.Production)
.setUserData(
UserData(
userId = "<email id of the user/user id as per your system>"
)
)
.setShootData(
ShootData(
// Provide at least one of the vehicle identifiers (vin, stockNumber, or registrationNumber)
vin = "<Vehicle identification Number>", //Should be 17 digit alphanumeric
stockNumber = "<Stock Number of vehicle as per your system>",
registrationNumber = "<Vehicle Registration Number>"
)
)
.setLocale("en") // language code
val spyne = builder.build()
spyne.startShoot()
Call this method when you’re ready to start the shoot process.
Updated 20 days ago