use of com.google.firebase.appdistribution.FirebaseAppDistribution in project firebase-android-sdk by firebase.
the class FirebaseAppDistributionRegistrar method buildFirebaseAppDistribution.
private FirebaseAppDistribution buildFirebaseAppDistribution(ComponentContainer container) {
FirebaseApp firebaseApp = container.get(FirebaseApp.class);
Context context = firebaseApp.getApplicationContext();
Provider<FirebaseInstallationsApi> firebaseInstallationsApiProvider = container.getProvider(FirebaseInstallationsApi.class);
SignInStorage signInStorage = new SignInStorage(context);
FirebaseAppDistributionTesterApiClient testerApiClient = new FirebaseAppDistributionTesterApiClient(firebaseApp, firebaseInstallationsApiProvider, new TesterApiHttpClient(firebaseApp));
FirebaseAppDistributionLifecycleNotifier lifecycleNotifier = FirebaseAppDistributionLifecycleNotifier.getInstance();
ApkHashExtractor apkHashExtractor = new ApkHashExtractor(firebaseApp.getApplicationContext());
FirebaseAppDistribution appDistribution = new FirebaseAppDistributionImpl(firebaseApp, new TesterSignInManager(firebaseApp, firebaseInstallationsApiProvider, signInStorage), new NewReleaseFetcher(firebaseApp.getApplicationContext(), testerApiClient, apkHashExtractor), new ApkUpdater(firebaseApp, new ApkInstaller()), new AabUpdater(), signInStorage, lifecycleNotifier);
if (context instanceof Application) {
Application firebaseApplication = (Application) context;
firebaseApplication.registerActivityLifecycleCallbacks(lifecycleNotifier);
} else {
LogWrapper.getInstance().e(TAG + "Context " + context + " was not an Application, can't register for lifecycle callbacks. SDK might not" + " function correctly.");
}
return appDistribution;
}
Aggregations