Skip to content

Commit

Permalink
[feature/#946] Modify App code
Browse files Browse the repository at this point in the history
  • Loading branch information
l2hyunwoo committed Nov 18, 2024
1 parent ccab044 commit 403552f
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions app/src/main/java/org/sopt/official/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,29 @@ import javax.inject.Inject

@HiltAndroidApp
class App : Application() {
@Inject
lateinit var dataStore: SoptDataStore
private val lifecycleOwner: LifecycleOwner
get() = ProcessLifecycleOwner.get()
@Inject
lateinit var dataStore: SoptDataStore
private val lifecycleOwner: LifecycleOwner
get() = ProcessLifecycleOwner.get()

override fun onCreate() {
super.onCreate()
appContext = this.applicationContext
override fun onCreate() {
super.onCreate()
appContext = this.applicationContext

initFlipper()
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
lifecycleOwner.lifecycleScope.launch {
lifecycleOwner.lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
runCatching {
FirebaseMessaging.getInstance().token.await()
}.onSuccess {
dataStore.pushToken = it
}.onFailure(Timber::e)
}
initFlipper()
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
lifecycleOwner.lifecycleScope.launch {
lifecycleOwner.lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
runCatching {
FirebaseMessaging.getInstance().token.await()
}.onSuccess {
dataStore.pushToken = it
}.onFailure(Timber::e)
}
}
}
}

private fun initFlipper() {
FlipperInitializer.init(this)
}
private fun initFlipper() {
FlipperInitializer.init(this)
}
}

0 comments on commit 403552f

Please sign in to comment.