Skip to main content

BlinkReceiptSdk

Singleton object for SDK initialization and global configuration. Call initialize() in Application.onCreate() before using any other SDK API.

Package: com.microblink

Declaration

object BlinkReceiptSdk

Quick Reference

Methods

MethodDescription
initialize(context)Initializes the SDK
initialize(context, callback)Initializes the SDK with a completion callback
initialize(context, licenseKey, callback)Initializes the SDK with a license key inline
terminate()Shuts down the SDK and releases resources

Properties

PropertyDescription
licenseKey()BlinkReceipt license key
licenseeName()Licensee name from the license
productIntelligenceKey()Product Intelligence key
clientUserId()Optional client-supplied user identifier
initialized()Whether the SDK has been initialized
onDeviceOcr()Enables or disables on-device OCR
onDeviceMinSdkVersionMinimum Android API level for on-device OCR
googleApiKey()Google API key
webApiKey()Web API key
yelpApiKey()Yelp API key
scanType()Configures the scan behavior type
frameResults()Whether to return per-frame results
daysToStoreScan(context)Number of days scan data is retained on-device
cpuPowerIndex()CPU performance metric for this device
versionName(context)SDK version name string
versionCode(context)SDK version code identifier
packageName(context)Application package name

Methods

initialize(context)

fun initialize(context: Context)

Initializes the SDK. License key and product intelligence key must be set before calling.


initialize(context, callback)

fun initialize(context: Context, callback: InitializeCallback)

Initializes the SDK and notifies callback when complete.


initialize(context, licenseKey, callback)

fun initialize(context: Context, licenseKey: String, callback: InitializeCallback)

Initializes the SDK with a license key inline.


terminate()

fun terminate()

Shuts down the SDK and releases resources.


Properties

licenseKey()

fun licenseKey(): String?
fun licenseKey(key: String)

BlinkReceipt license key. Must be set before initialize().


licenseeName()

fun licenseeName(): String?

Returns the licensee name from the license.


productIntelligenceKey()

fun productIntelligenceKey(): String?
fun productIntelligenceKey(key: String)

Product Intelligence key. Required for enriched product data (name, brand, category, UPC).


clientUserId()

fun clientUserId(): String?
fun clientUserId(id: String)

Optional client-supplied user identifier for mapping scan data to your own user records.


initialized()

fun initialized(): Boolean

Returns true once initialize() has completed successfully.


onDeviceOcr()

fun onDeviceOcr(): Boolean
fun onDeviceOcr(enabled: Boolean)

Enables or disables on-device OCR processing. Requires minSdkVersiononDeviceMinSdkVersion.

Default: false


onDeviceMinSdkVersion

val onDeviceMinSdkVersion: Int // = 23

Minimum Android API level required for on-device OCR.


googleApiKey()

fun googleApiKey(): String?
fun googleApiKey(key: String)

Google API key, used for place/merchant lookup.


webApiKey()

fun webApiKey(): String?
fun webApiKey(key: String)

Web API key for server-side requests.


yelpApiKey()

fun yelpApiKey(): String?
fun yelpApiKey(key: String)

Yelp API key getter/setter.


scanType()

fun scanType(): ScanType
fun scanType(type: ScanType)

Configures the scan behavior type.


frameResults()

fun frameResults(): Boolean
fun frameResults(enabled: Boolean)

Whether to return per-frame results during scanning.

Default: false


daysToStoreScan(context)

fun daysToStoreScan(context: Context): Int?
fun daysToStoreScan(context: Context, days: Int)

Number of days scan data is retained on-device. Pass 0 to disable retention.


cpuPowerIndex()

fun cpuPowerIndex(): Float

Returns a CPU performance metric for this device.


versionName(context)

fun versionName(context: Context): String

SDK version name string.


versionCode(context)

fun versionCode(context: Context): String

SDK version code identifier.


packageName(context)

fun packageName(context: Context): String

Returns the application package name.