Skip to content

Commit 15db9a9

Browse files
authored
AppLifecycle handler is now subscribed after the complete initialization (#585)
1 parent e74a891 commit 15db9a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sdk/src/main/java/com/qonversion/android/sdk/internal/QonversionInternal.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ internal class QonversionInternal(
5757
override var appState = AppState.Background
5858

5959
init {
60-
val lifecycleHandler = AppLifecycleHandler(this)
61-
postToMainThread { ProcessLifecycleOwner.get().lifecycle.addObserver(lifecycleHandler) }
62-
6360
QDependencyInjector.buildAppComponent(application, internalConfig, this)
6461

6562
exceptionManager = QDependencyInjector.appComponent.exceptionManager().also {
@@ -107,6 +104,9 @@ internal class QonversionInternal(
107104
userPropertiesManager.productCenterManager = productCenterManager
108105
userPropertiesManager.sendFacebookAttribution()
109106

107+
val lifecycleHandler = AppLifecycleHandler(this)
108+
postToMainThread { ProcessLifecycleOwner.get().lifecycle.addObserver(lifecycleHandler) }
109+
110110
launch()
111111
}
112112

0 commit comments

Comments
 (0)