package com.base.filerecoveryrecyclebin.billing

import android.app.Application
import android.content.Context
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.MutableLiveData
import com.android.billingclient.api.BillingClient
import com.android.billingclient.api.ProductDetails

class BillingViewModel(val application: Application) : AndroidViewModel(application) {

    private lateinit var billingClient: BillingClient


//    val billingClientLifecycle: BillingClientLifecycle
//        get() = BillingClientLifecycle.getInstance(this)

    @Volatile
    private var INSTANCE: BillingClientLifecycle? = null
    fun getInstance(applicationContext: Context): BillingClientLifecycle =
        INSTANCE ?: synchronized(this) {
            INSTANCE ?: BillingClientLifecycle(application.applicationContext).also { INSTANCE = it }
        }

    val basicSubProductWithProductDetails = MutableLiveData<ProductDetails?>()

}