com.bear.common.sdk / BearSdk

BearSdk

open class BearSdk

This class is used to initialize database and native libraries for BEAR SDK. BearSdk instance can be retrieved with getInstance method. To initiate BEAR SDK init method must be called in the android.app.Application.onCreate method.

Properties

androidId

val androidId: String

The UDID of the current device.

deviceId

val deviceId: Int

The id of the current device registered at Bear backend, 0 if not registered yet.

Functions

init

fun init(secretKey: String, isDev: Boolean = false): Unit

Initialize BEAR SDK. The secretKey must be provided for SDK initialization. This method must be called in the android.app.Application.onCreate method.

fun <R : IJsonConfig, T : AbstractRestJsonConfig<R>> init(secretKey: String, isDev: Boolean, classType: Class<T>?, configVersion: String, authInterceptor: AuthInterceptor?): Unit

registerFirebaseToken

fun registerFirebaseToken(token: String): Unit
fun registerFirebaseToken(token: String, onSuccessAction: (Int) -> Unit): Unit

Provide the firebase notification token to SDK to register it in Bear backend. This method must be called to enable push notifications.

Companion Object Functions

getInstance

fun getInstance(context: Context): BearSdk

Retrieve singleton instance of BearSdk.