Steps to Integrate

Follow these steps to add and initialize the SpyneAutomobile SDK in your iOS application.

1. Add the SDK Package Dependency

The SpyneAutomobile SDK is distributed through Swift Package Manager (SPM).

  1. Open your project in Xcode, Navigate to: Project Settings → Package Dependencies

  2. Click the + button to add a new package.

  3. Add the following package dependencies:

    SpyneAutomobileSDK

    https://github.com/spyne-ai-tech/SpyneAutomobileSDK

    AWS SDK for iOS

    https://github.com/aws-amplify/aws-sdk-ios-spm

  4. Select the latest SDK version & Add the package to your application target.


2. Verify Framework Integration

After adding the package, ensure the SDK is linked correctly to your application target.

  1. Select your project in the Project Navigator & Select your main application target.
  2. Open the General tab & Navigate to Frameworks, Libraries, and Embedded Content.
  3. Verify that SpyneAutomobileSDK appears in the list.
  4. If it is not listed, click + and add it manually & Set the embed option to: Embed & Sign

Once completed, the SDK is ready for initialization.


3. Initialize the Spyne SDK

📘

Take the SDK API key from your Spyne's POC.

Before using any Spyne SDK functionality, initialize the SDK during your application's launch process.

//in: application(_:didFinishLaunchingWithOptions:)

SpyneAutomobile.SpyneAutomobileSDK.initialize(apiKey: your_api_key)

4. Configure AWS S3 Transfer Utility

The SDK uses AWS S3 Transfer Utility for image and media uploads. Configure AWS before launching any Spyne workflows

//in: application(_:didFinishLaunchingWithOptions:)

let transferUtilityConfiguration = AWSS3TransferUtilityConfiguration()
transferUtilityConfiguration.isAccelerateModeEnabled = true

// Create the AWS service configuration
guard let serviceConfiguration = AWSServiceManager.default().defaultServiceConfiguration else {
    print("AWS defaultServiceConfiguration is nil after AWSMobileClient initialization")
    return
}

AWSS3TransferUtility.register(
    with: serviceConfiguration,
    transferUtilityConfiguration: transferUtilityConfiguration,
    forKey: "transferUtilityKey"
) { error in
    if let error = error {
        print("Error registering Transfer Utility: \(error.localizedDescription)")
    }
}