package com.casic.br.base

import android.app.Application
import android.util.Log
import com.igexin.sdk.PushManager
import com.pengxh.kt.lite.utils.SaveKeyValues
import com.tuya.smart.home.sdk.TuyaHomeSdk
import kotlin.properties.Delegates


class BaseApplication : Application() {

    private val kTag = "BaseApplication"

    companion object {
        private var instance: BaseApplication by Delegates.notNull()

        fun obtainInstance() = instance
    }

    override fun onCreate() {
        super.onCreate()
        instance = this
        SaveKeyValues.initSharedPreferences(this)
        //推送
        PushManager.getInstance().initialize(this)
        PushManager.getInstance().setDebugLogger(this) {
            Log.d(kTag, it)
        }
        TuyaHomeSdk.init(this)
        TuyaHomeSdk.setDebugMode(true)
    }
}