Search in sources :

Example 1 with FirebaseAppDistribution

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;
}
Also used : Context(android.content.Context) FirebaseInstallationsApi(com.google.firebase.installations.FirebaseInstallationsApi) Application(android.app.Application) FirebaseApp(com.google.firebase.FirebaseApp) FirebaseAppDistribution(com.google.firebase.appdistribution.FirebaseAppDistribution)

Aggregations

Application (android.app.Application)1 Context (android.content.Context)1 FirebaseApp (com.google.firebase.FirebaseApp)1 FirebaseAppDistribution (com.google.firebase.appdistribution.FirebaseAppDistribution)1 FirebaseInstallationsApi (com.google.firebase.installations.FirebaseInstallationsApi)1