Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import kotlin.coroutines.resume

@Singleton
class FirebasePushTokenProvider @Inject constructor() : PushTokenProvider {
// TODO(firebase-messaging): 25.1.0 deprecated token-based registration (getToken/deleteToken)
// in favor of FID-based register()/unregister(). Migrate once Firebase ships a stable guide and
// the backend accepts FID registration.
// Tracking: https://github.com/firebase/firebase-android-sdk/issues/8087
@Suppress("DEPRECATION")
override suspend fun getToken(): String? = suspendCancellableCoroutine { cont ->
FirebaseMessaging.getInstance().token
.addOnCanceledListener { cont.resume(null) }
Expand All @@ -20,6 +25,7 @@ class FirebasePushTokenProvider @Inject constructor() : PushTokenProvider {
.addOnSuccessListener { cont.resume(it) }
}

@Suppress("DEPRECATION")
override suspend fun deleteToken() {
FirebaseMessaging.getInstance().deleteToken()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ class NotificationService : FirebaseMessagingService(),
@Inject
lateinit var chatCoordinator: ChatCoordinator

// TODO(firebase-messaging): 25.1.0 deprecated onNewToken in favor of FID-based onRegistered().
// Migrate once Firebase ships a stable guide and the backend accepts FID registration.
// Tracking: https://github.com/firebase/firebase-android-sdk/issues/8087
@Suppress("DEPRECATION")
override fun onNewToken(token: String) {
super.onNewToken(token)
authenticateIfNeeded {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ retrofit = "3.0.0"
kin-sdk = "2.1.2"
grpc-android = "1.82.2"
slf4j = "1.7.36"
firebase-bom = "34.15.0"
firebase-bom = "34.16.0"
play-service-ml-barcode = "18.3.1"
play-services-auth-api-phone = "18.3.1"
google-play-billing = "9.1.0"
Expand Down
Loading