Files
hpos/app/src/main/java/com/example/hpostesting/HPOSTestingApplication.kt

25 lines
909 B
Kotlin
Raw Normal View History

2023-06-28 12:41:18 +05:30
package com.example.hpostesting
import android.app.Application
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
@HiltAndroidApp
2024-02-14 12:47:39 +05:30
class HPOSTestingApplication : Application() {
2023-06-28 12:41:18 +05:30
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
}