Skip to content

Subscription Details

This scheme describes internal configuration / subscription details that SDK will request by calling /subscription_details.

Etag and caching
  • The SDK should store the Etag value from the response in local storage alongside the cached data.
  • On subsequent requests the SDK should include cached Etag value in the if-none-match header.
  • If the configuration hasn't changed, the server will respond with a 304 status code. Otherwise, it will return the updated configuration and a new Etag that shoul be updated in the storage for the further requests.
Convert from snake_case

While API uses snake_case for field names, the SDK schemes adhere to a camelCase convention.

Scheme

SubscriptionDetails {
  poweredBySticker: PoweredBySticker | null // (1)!
  retryCounts: RetryCounts | null // (2)!
  operationDelaysSequence: List<OperationDelay> | null // (3)!
}
  1. Controls the behavior of the “Powered by Aiuta” label that may be present on some SDK screens (e.g. the progress animation screen).

    Defaults

    urlIos: null
    urlAndroid: null
    isVisible: false
    
  2. Specifies the number of additional attempts if an error occurs on a particular action before the user is shown an error telling them that something went wrong (the user can click the try again button to restart the process).

    Defaults

    photoUpload: 2
    operationStart: 0
    operationStatus: 2
    resultDownload: 2
    
  3. Sequence of delays before requesting the generation operation status.

    If the sequence does not contain a value with an infinite mode and ends before a successful result is obtained, the operation will fail with a timeout error, the user will be shown a "something went wrong" error.

    Defaults

    [
      {
        mode: recurring
        delay: 1
        repeat: 4
      },
      {
        mode: recurring
        delay: 0.5
        repeat: 20
      },
      {
        mode: infinite
        delay: 3
      }
    ]
    

Powered By Sticker

PoweredBySticker {
  urlIos: String | null // (1)!
  urlAndroid: String | null // (2)!
  isVisible: true | false | null // (3)!
}
  1. URL for iOS to open by click on the "powered by" label. If not specified the label interaction is disabled.

    Default is null and "powered by" label is not interactive.

  2. URL for Android to open by click on the "powered by" label. If not specified the label interaction is disabled.

    Default is null and "powered by" label is not interactive.

  3. The only value to "powered by" label be visible is explicit true in the subscription details. In any other case "powered by" is hidden.

    Default is false and "powered by" label is hidden.

Retry Counts

RetryCounts {
  photoUpload: Int | null // (1)!
  operationStart: Int | null // (2)!
  operationStatus: Int | null // (3)!
  resultDownload: Int | null // (4)!
}
  1. Number of retries for photo uploading

    2 by default

  2. Number of network request retries to start try-on operation, has no effect if the server responds with error

    0 by default

  3. Number of network request retries per loop to check operation status, if the server responded, the number of retries will reset in the next loop after the delay in the operationDelaysSequence

    2 by default

  4. Number of retries to load the generated image

    2 by default

Operation Delays

OperationDelay {
  mode: recurring // (1)!
  delay: Double // (2)!
  repeat: Int // (3)!
}
  1. recurring delay will be repeated a specified repeat number of times.

  2. Delay in seconds before next request the operation status.

  3. Number of repeates for the recurring delay.

OperationDelay {
  mode: infinite // (1)!
  delay: Double // (2)!
}
  1. infinite delay will repeat infinitely.

  2. Delay in seconds before next request the operation status.

Timeout error

If the sequence does not contain a value with an infinite mode and ends before a successful result is obtained, the operation will fail with a timeout error, the user will be shown a "something went wrong" error.