Start a shoot from JavaScript
Wrap NativeModules.Spyne so the app fails loudly if the native side is not linked, then call start:
import { NativeModules } from 'react-native';
const Spyne = NativeModules.Spyne
? NativeModules.Spyne
: new Proxy({}, { get() { throw new Error('NativeModules.Spyne is not linked. Rebuild the native app.'); } });
export const start = (userId, vin, stockNumber, registrationNumber, locale = 'en') =>
Spyne.start(userId, vin, stockNumber, registrationNumber, locale);The native side turns this into a SpyneAutomobileSDK.Builder(...).build().startShoot() call.
Provide userId and at least one of vin, stockNumber, or registrationNumber. startShoot() automatically resumes a draft, starts a reshoot, or begins a new shoot based on the identifiers — see Initiate a Shoot and Resume a Shoot.
Validate in JavaScript before sending:
| Rule | Message |
|---|---|
| userId non-empty | User ID is required |
| At least one identifier | Provide a VIN, stock number, or registration number |
| VIN, if provided, is exactly 17 characters | VIN must be exactly 17 characters long |
| VIN excludes I, O, Q | VIN may only contain A–Z and 0–9 (excluding I, O, Q) |
Updated 1 day ago
Did this page help you?
