Skip to content

Commit

Permalink
Add appcheck and play integrity to gradle
Browse files Browse the repository at this point in the history
Also initialize app check
  • Loading branch information
adhiamboperes committed Aug 1, 2023
1 parent dc5dac3 commit ffdeb2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ dependencies {
'com.google.dagger:dagger:2.24',
'com.google.firebase:firebase-analytics:17.5.0',
'com.google.firebase:firebase-analytics-ktx:17.5.0',
'com.google.firebase:firebase-appcheck:16.0.0',
'com.google.firebase:firebase-appcheck-playintegrity:16.0.0',
'com.google.firebase:firebase-core:17.5.0',
'com.google.firebase:firebase-crashlytics:17.0.0',
'com.google.guava:guava:28.1-android',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import androidx.multidex.MultiDexApplication
import androidx.work.Configuration
import androidx.work.WorkManager
import com.google.firebase.FirebaseApp
import com.google.firebase.appcheck.FirebaseAppCheck
import com.google.firebase.appcheck.playintegrity.PlayIntegrityAppCheckProviderFactory
import org.oppia.android.app.activity.ActivityComponent
import org.oppia.android.app.activity.ActivityComponentFactory
import org.oppia.android.domain.oppialogger.ApplicationStartupListener
Expand Down Expand Up @@ -47,6 +49,9 @@ abstract class AbstractOppiaApplication(
// TODO(#4751): Re-enable WorkManager for S+.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
FirebaseApp.initializeApp(applicationContext)
FirebaseAppCheck.getInstance().installAppCheckProviderFactory(
PlayIntegrityAppCheckProviderFactory.getInstance(),
)
WorkManager.initialize(applicationContext, workManagerConfiguration)
val workManager = WorkManager.getInstance(applicationContext)
component.getAnalyticsStartupListenerStartupListeners().forEach { it.onCreate(workManager) }
Expand Down

0 comments on commit ffdeb2b

Please sign in to comment.