Merge pull request #700 from android/tj/update-sync-notification-sender

Update message sender in SyncNotificationsService
pull/703/head
Adetunji Dahunsi 2 years ago committed by GitHub
commit d905701028
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,10 +19,11 @@ package com.google.samples.apps.nowinandroid.sync.services
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import com.google.samples.apps.nowinandroid.core.data.util.SyncManager
import com.google.samples.apps.nowinandroid.sync.initializers.SYNC_TOPIC
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
private const val SYNC_TOPIC_SENDER = "/topics/sync"
@AndroidEntryPoint
class SyncNotificationsService : FirebaseMessagingService() {
@ -30,7 +31,7 @@ class SyncNotificationsService : FirebaseMessagingService() {
lateinit var syncManager: SyncManager
override fun onMessageReceived(message: RemoteMessage) {
if (SYNC_TOPIC == message.from) {
if (SYNC_TOPIC_SENDER == message.from) {
syncManager.requestSync()
}
}

Loading…
Cancel
Save