Set up the bridge

Two channels are shared by both platforms:

ChannelNamePurpose
Method channelcom.spyne.spyne_sdk_flutter/spyneCommands (start)
Event channelcom.spyne.spyne_sdk_flutter/spyne_eventsShoot lifecycle events

iOS

Register the plugin when Flutter creates its implicit engine:

// ios/Runner/AppDelegate.swift
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
  GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
  SpynePlugin.register(with: engineBridge.applicationRegistrar.messenger())
}

The plugin owns both channels, initializes the SDK with SpyneAutomobileSDK.initialize(apiKey:), and drives the Builder.

Note: SpynePlugin exposes the native SpyneAutomobileSDK to Flutter. It acts as an adapter/bridge: Flutter starts a vehicle shoot through the plugin, the native Spyne flow is launched, and shoot lifecycle events are forwarded back to Flutter.

SpynePlugin is an internal class and does not handle the actual camera or vehicle shooting logic. This is only a demonstration of how to call SpyneAutomobileSDK methods.

For more details, please check the Sample Project.

Android

Set up the channels in MainActivity and drive the same Builder.

⚠️ Spyne activities extend AppCompatActivity, so your <application> must use an AppCompat theme (Theme.AppCompat.DayNight.NoActionBar), or ShootPreparationActivity will crash. Keep Flutter's LaunchTheme on MainActivity.


Did this page help you?