Skip to content

Instantly share code, notes, and snippets.

View risalfajar's full-sized avatar
🏠
Working from home

Risal Fajar Amiyardi risalfajar

🏠
Working from home
View GitHub Profile
@risalfajar
risalfajar / MyApplication.kt
Last active February 6, 2022 09:18
Integrate Crashlytics into Timber
/**
* Application class integrated with Timber and Crashlytics
*/
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
if(BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
else Timber.plant(FirebaseCrashlyticsReportingTree())
}
@risalfajar
risalfajar / BillingRepository.kt
Created August 31, 2020 12:55
Billing Repository Full
class BillingRepository private constructor(private val application: Application) :
PurchasesUpdatedListener, BillingClientStateListener {
private lateinit var playStoreBillingClient: BillingClient
val coinsSkuDetailsListLiveData: MutableLiveData<List<SkuDetails>> = MutableLiveData()
val subsSkuDetailsListLiveData: MutableLiveData<List<SkuDetails>> = MutableLiveData()
companion object {
@Volatile
private var INSTANCE: BillingRepository? = null