Set up the bridge
The bridge exposes one native module, Spyne, with a start method and lifecycle events. The JavaScript API is identical on both platforms.
iOS
Export the Swift module to React Native (SpyneModule.m):
@interface RCT_EXTERN_MODULE(Spyne, RCTEventEmitter)
RCT_EXTERN_METHOD(start:(NSString *)userId
vin:(NSString *)vin
stockNumber:(NSString *)stockNumber
registrationNumber:(NSString *)registrationNumber
locale:(NSString *)locale)
@end
SpyneModule.swift subclasses RCTEventEmitter, conforms to SpyneShootDelegate, initializes the SDK with SpyneAutomobileSDK.initialize(apiKey:), and drives the Builder. Bootstrap AWS in the AppDelegate ([AWSBootstrap configure]) before any shoot starts.
⚠️ Spyne capture runs in landscape. Declare landscape orientations in Info.plist (UISupportedInterfaceOrientations) or the SDK cannot rotate into the capture UI. A camera usage description (NSCameraUsageDescription) is also required.
Android
Register a native module and package:
- SpyneModule.kt — extends ReactContextBaseJavaModule, implements SpyneAutomobileSDK.SpyneShootListener, exposes start(...), and emits events via RCTDeviceEventEmitter. getName() returns "Spyne".
- SpynePackage.kt — returns SpyneModule from createNativeModules(...).
- MainApplication.kt — add SpynePackage() to getPackages() and call SpyneAutomobileSDK.init(this, API_KEY) in onCreate().
Updated 1 day ago
Did this page help you?
