Receive lifecycle callbacks
The native SDKs use different callback APIs — iOS uses the SpyneShootDelegate protocol, Android uses the SpyneShootListener interface — and the method names differ. The bridge forwards both onto the event channel using a single, unified set of event names, so your Dart code stays the same on both platforms:
static const _eventChannel = EventChannel('com.spyne.spyne_sdk_flutter/spyne_events');
_eventChannel.receiveBroadcastStream().listen((event) {
final map = Map<String, dynamic>.from(event as Map);
switch (map['event'] as String) {
case 'onShootInitiated': break; // shootData, dealerVinId, mediaId, status
case 'onShootCompleted': break; // shootData, dealerVinId, mediaId, isReshoot
case 'onShootExit': break; // shootData, dealerVinId, mediaId
}
});Each Dart event is forwarded from the corresponding native callback:
| Dart 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 inventoryId 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 20 days ago
Did this page help you?
