IBcmGlobalConfig

The SDK global configuration interface (IBcmGlobalConfig) is a non optional interface. The interface is used for configuring underlying Biocapture SDK components, such as API keys, and global branding. You can consume this class by subclassing it, which enables lazy value computation.

Interface

Kotlin:

open class IBcmGlobalConfig {

    /**
     * SDK licencing and activation
     */
    open fun licenseKey(): String? = null

    /**
     * Branding configuration interface; can be overwritten
     */
    open fun branding(): IBcmBranding = IBcmBranding()

}

Example

Kotlin:

class BcmGlobalConfig() : IBcmGlobalConfig() {

    override fun licenseKey(): String = "license-key"
    override fun branding(): IBcmBranding = BcmBranding()
    ...

}

Java:

public class BcmGlobalConfig extends IBcmGlobalConfig {

    public BcmGlobalConfig() {
        super();
    }

    @Override
    public String licenseKey() {
        return "license-key";
    }

    @Nullable
    @Override
    public IBcmBranding branding() {
        return new BcmBranding();
    }

    ...

}

Usage

You can either inherit from the SDK Scan Activity (BcmScanActivity) and set the globalConfig or set the globalConfig at the Fragment level (BcmScanFragment).

Set the globalConfig at the Scan Activity level (BcmScanActivity)

Kotlin:

class BcmScanActivityOverride : BcmScanActivity() {

    /**
     * Set config take place here
     */
    init {
        globalConfig = BcmGlobalConfig()
    }

}

Java:

public class BcmScanActivityOverride extends BcmScanActivity {

    // Instance initialization block
    /**
     * Set config take place here
     */
    {
        setGlobalConfig(new BcmGlobalConfig());
    }

}

Set the globalConfig at the Scan Fragment level (BcmScanFragment)

Kotlin:

val scanFragment: ScanFragment = BcmScanFragment(
                BcmGlobalConfig(),
                BcmScanConfig(),
                this);

Java:

BcmScanFragment scanFragment  = new BcmScanFragment(
                new BcmGlobalConfig(),
                new BcmScanConfig(),
                this);

See Also

results matching ""

    No results matching ""