2023-06-28 12:41:18 +05:30
|
|
|
package com.example.hpostesting
|
|
|
|
|
|
|
|
|
|
import android.app.Application
|
2023-07-25 11:40:10 +05:30
|
|
|
import android.content.Context
|
|
|
|
|
import androidx.room.Room
|
|
|
|
|
import com.example.hpostesting.data.dao.MyDatabase
|
|
|
|
|
import com.google.android.datatransport.runtime.dagger.Provides
|
2023-09-16 05:43:27 +00:00
|
|
|
import com.google.firebase.firestore.FirebaseFirestore
|
|
|
|
|
import com.google.firebase.firestore.FirebaseFirestoreSettings
|
2023-06-28 12:41:18 +05:30
|
|
|
import dagger.hilt.android.HiltAndroidApp
|
|
|
|
|
import kotlinx.coroutines.CoroutineScope
|
|
|
|
|
import kotlinx.coroutines.Dispatchers
|
|
|
|
|
import kotlinx.coroutines.SupervisorJob
|
2023-07-25 11:40:10 +05:30
|
|
|
import javax.inject.Singleton
|
2023-06-28 12:41:18 +05:30
|
|
|
|
|
|
|
|
@HiltAndroidApp
|
|
|
|
|
class HPOSTestingApplication: Application() {
|
|
|
|
|
val applicationScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
2023-07-25 11:40:10 +05:30
|
|
|
|
2023-09-16 05:43:27 +00:00
|
|
|
override fun onCreate() {
|
|
|
|
|
super.onCreate()
|
|
|
|
|
val applicationScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
|
|
|
|
val firestoreSettings = FirebaseFirestoreSettings.Builder()
|
|
|
|
|
.setPersistenceEnabled(true) // Enable offline persistence if needed
|
|
|
|
|
.build()
|
2023-07-25 11:40:10 +05:30
|
|
|
|
2023-09-16 05:43:27 +00:00
|
|
|
val firestore = FirebaseFirestore.getInstance()
|
|
|
|
|
firestore.firestoreSettings = firestoreSettings
|
|
|
|
|
}
|
2023-06-28 12:41:18 +05:30
|
|
|
}
|