1
0
Fork 0

For #4063 - Always enable the push service (#4932)

master
Jeff Boek 2019-08-27 13:12:29 -07:00 committed by GitHub
parent d1964d6536
commit bfb2beabe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -66,6 +66,8 @@ open class FenixApplication : Application() {
return return
} }
setupPush()
// Make sure the engine is initialized and ready to use. // Make sure the engine is initialized and ready to use.
components.core.engine.warmUp() components.core.engine.warmUp()
@ -181,6 +183,13 @@ open class FenixApplication : Application() {
} }
} }
private fun setupPush() {
components
.backgroundServices
.push
.initialize()
}
private fun setupCrashReporting() { private fun setupCrashReporting() {
components components
.analytics .analytics

View File

@ -137,8 +137,6 @@ class BackgroundServices(
*/ */
private val accountObserver = object : AccountObserver { private val accountObserver = object : AccountObserver {
override fun onLoggedOut() { override fun onLoggedOut() {
pushService.stop()
push.unsubscribeForType(PushType.Services) push.unsubscribeForType(PushType.Services)
context.components.analytics.metrics.track(Event.SyncAuthSignOut) context.components.analytics.metrics.track(Event.SyncAuthSignOut)
@ -147,8 +145,6 @@ class BackgroundServices(
} }
override fun onAuthenticated(account: OAuthAccount, newAccount: Boolean) { override fun onAuthenticated(account: OAuthAccount, newAccount: Boolean) {
pushService.start(context)
if (newAccount) { if (newAccount) {
context.components.analytics.metrics.track(Event.FXANewSignup) context.components.analytics.metrics.track(Event.FXANewSignup)
push.subscribeForType(PushType.Services) push.subscribeForType(PushType.Services)