Receive lifecycle callbacks
The native SDKs use different callback APIs: - iOS: SpyneShootDelegate protocol - Android: SpyneShootListener interface The method names differ between platforms. However, the bridge forwards both through a single, unified set of event names, so your JavaScript stays the same on both platforms.
import { NativeEventEmitter, NativeModules } from 'react-native';
const spyneEvents = new NativeEventEmitter(NativeModules.Spyne);
useEffect(() => {
const subs = [
spyneEvents.addListener('onShootInitiated', e => { /* shootData, dealerVinId, mediaId, status */ }),
spyneEvents.addListener('onShootCompleted', e => { /* shootData, dealerVinId, mediaId, isReshoot */ }),
spyneEvents.addListener('onShootExit', e => { /* shootData, dealerVinId, mediaId */ }),
];
return () => subs.forEach(s => s.remove());
}, []);| JS event | iOS — SpyneShootDelegate | Android — SpyneShootListener | Parameters |
|---|---|---|---|
| onShootInitiated | shootDidInitiate(...) | onShootInitiated(...) | shootData, dealerVinId, mediaId, status |
| onShootCompleted | shootDidComplete(...) | onShootCompleted(...) | shootData, dealerVinId, mediaId, isReshoot |
| onShootExit | shootDidExit(...) | onShootExit(...) | shootData, dealerVinId, mediaId |
dealerVinId is the id used by the webhook / GET media APIs; mediaId tracks the shoot session. For full callback semantics, see the platform doc: iOS Callbacks · Android Callbacks.
Updated 1 day ago
Did this page help you?
