Config

data class Config(var endpointBaseUrl: String = Environment.PRODUCTION.baseUrl, var appId: String? = null, var secret: String? = null, var bundledMetadataAssetPath: String? = null, var bundledMetadataRawResId: Int = 0, var generateSearchIndex: Boolean = false, var maxProductDatabaseAge: Long = TimeUnit.HOURS.toMillis(1), var maxShoppingCartAge: Long = TimeUnit.HOURS.toMillis(4), var disableCertificatePinning: Boolean = false, var initialSQL: List<String> = emptyList(), var vibrateToConfirmCartFilled: Boolean = false, var loadActiveShops: Boolean = false, var checkInRadius: Float = 500.0f, var checkOutRadius: Float = 1000.0f, var lastSeenThreshold: Long = TimeUnit.MINUTES.toMillis(15), var networkInterceptor: Interceptor? = null, var manualProductDatabaseUpdates: Boolean = false)

Configuration of the snabble SDK.

Constructors

Link copied to clipboard
constructor(endpointBaseUrl: String = Environment.PRODUCTION.baseUrl, appId: String? = null, secret: String? = null, bundledMetadataAssetPath: String? = null, bundledMetadataRawResId: Int = 0, generateSearchIndex: Boolean = false, maxProductDatabaseAge: Long = TimeUnit.HOURS.toMillis(1), maxShoppingCartAge: Long = TimeUnit.HOURS.toMillis(4), disableCertificatePinning: Boolean = false, initialSQL: List<String> = emptyList(), vibrateToConfirmCartFilled: Boolean = false, loadActiveShops: Boolean = false, checkInRadius: Float = 500.0f, checkOutRadius: Float = 1000.0f, lastSeenThreshold: Long = TimeUnit.MINUTES.toMillis(15), networkInterceptor: Interceptor? = null, manualProductDatabaseUpdates: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The project identifier, which is used in the communication with the backend.

Link copied to clipboard

Relative path from the assets folder which points to a bundled file which contains the metadata.

Link copied to clipboard

Resource id of the raw file which contains the metadata.

Link copied to clipboard

The radius in which the CheckInManager tries to check in a shop.

Link copied to clipboard

The radius in which the CheckInManager tries to stay in a shop, if already in it. If outside of this radius and the lastSeenThreshold, you will be checked out.

Link copied to clipboard

If set to true, disables certificate pinning. Not recommended for production!

Link copied to clipboard

The endpoint url of the snabble backend. For example "https://api.snabble.io" for the Production environment.

Link copied to clipboard

If set to true, creates an full text index to support searching in the product database using findByName or searchByName.

Link copied to clipboard

SQL queries that will get executed in order on the product database.

Link copied to clipboard

The time in milliseconds which we keep you checked in at a shop.

Link copied to clipboard

Set to true, to load shops that are marked as pre launch and are not part of the original metadata in the backend (for example for testing shops in production before a go-live)

Link copied to clipboard

Set to true if you want to control when the product database gets updated, otherwise the product database gets updated when checking in and if checked in when the app resumes

Link copied to clipboard

The time that the database is allowed to be out of date. After the specified time in milliseconds the database only uses online requests for asynchronous requests.

Link copied to clipboard

The time that the shopping cart is allowed to be alive after the last modification.

Link copied to clipboard
var networkInterceptor: Interceptor?

Network interceptor used for all calls made by the SDK.

Link copied to clipboard

The secret needed for Totp token generation

Link copied to clipboard

Vibrate while adding a product to the cart, by default false.

Functions

Link copied to clipboard
fun save(context: Context)