Skip to content

Commit eefb794

Browse files
authored
add FirebaseAppCheckKtxRegistrar to appcheck-ktx (#4003)
* add FirebaseAppCheckKtxRegistrar to appcheck-ktx * add missing imports * remove keep annotation
1 parent d40db69 commit eefb794

File tree

1 file changed

+11
-0
lines changed
  • appcheck/firebase-appcheck/ktx/src/main/kotlin/com/google/firebase/appcheck/ktx

1 file changed

+11
-0
lines changed

appcheck/firebase-appcheck/ktx/src/main/kotlin/com/google/firebase/appcheck/ktx/FirebaseAppCheck.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@
1414

1515
package com.google.firebase.appcheck.ktx
1616

17+
import com.google.firebase.BuildConfig
1718
import com.google.firebase.FirebaseApp
1819
import com.google.firebase.appcheck.AppCheckToken
1920
import com.google.firebase.appcheck.FirebaseAppCheck
21+
import com.google.firebase.components.Component
22+
import com.google.firebase.components.ComponentRegistrar
2023
import com.google.firebase.ktx.Firebase
24+
import com.google.firebase.platforminfo.LibraryVersionComponent
2125

2226
/** Returns the [FirebaseAppCheck] instance of the default [FirebaseApp]. */
2327
val Firebase.appCheck: FirebaseAppCheck
@@ -39,3 +43,10 @@ operator fun AppCheckToken.component1() = token
3943
* @return the expireTimeMillis of the [AppCheckToken]
4044
*/
4145
operator fun AppCheckToken.component2() = expireTimeMillis
46+
47+
internal const val LIBRARY_NAME: String = "fire-app-check-ktx"
48+
49+
class FirebaseAppCheckKtxRegistrar : ComponentRegistrar {
50+
override fun getComponents(): List<Component<*>> =
51+
listOf(LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME))
52+
}

0 commit comments

Comments
 (0)