use of com.google.firebase.installations.FirebaseInstallationsApi 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;
}
use of com.google.firebase.installations.FirebaseInstallationsApi in project firebase-android-sdk by firebase.
the class IdManagerTest method createIdManager.
private IdManager createIdManager(String instanceId, DataCollectionArbiter arbiter) {
FirebaseInstallationsApi iid = mock(FirebaseInstallationsApi.class);
when(iid.getId()).thenReturn(Tasks.forResult(instanceId));
return new IdManager(getContext(), getContext().getPackageName(), iid, arbiter);
}
use of com.google.firebase.installations.FirebaseInstallationsApi in project firebase-android-sdk by firebase.
the class FirebaseInAppMessagingRegistrar method providesFirebaseInAppMessaging.
private FirebaseInAppMessaging providesFirebaseInAppMessaging(ComponentContainer container) {
FirebaseApp firebaseApp = container.get(FirebaseApp.class);
FirebaseInstallationsApi firebaseInstallations = container.get(FirebaseInstallationsApi.class);
Deferred<AnalyticsConnector> analyticsConnector = container.getDeferred(AnalyticsConnector.class);
Subscriber firebaseEventsSubscriber = container.get(Subscriber.class);
Application application = (Application) firebaseApp.getApplicationContext();
UniversalComponent universalComponent = DaggerUniversalComponent.builder().applicationModule(new ApplicationModule(application)).appMeasurementModule(new AppMeasurementModule(analyticsConnector, firebaseEventsSubscriber)).analyticsEventsModule(new AnalyticsEventsModule()).programmaticContextualTriggerFlowableModule(new ProgrammaticContextualTriggerFlowableModule(new ProgramaticContextualTriggers())).build();
AppComponent instance = DaggerAppComponent.builder().abtIntegrationHelper(new AbtIntegrationHelper(container.get(AbtComponent.class).get(FirebaseABTesting.OriginService.INAPP_MESSAGING))).apiClientModule(new ApiClientModule(firebaseApp, firebaseInstallations, universalComponent.clock())).grpcClientModule(new GrpcClientModule(firebaseApp)).universalComponent(universalComponent).transportFactory(container.get(TransportFactory.class)).build();
return instance.providesFirebaseInAppMessaging();
}
use of com.google.firebase.installations.FirebaseInstallationsApi in project firebase-android-sdk by firebase.
the class CLSUUIDTest method setUp.
protected void setUp() throws Exception {
super.setUp();
FirebaseInstallationsApi installationsApiMock = mock(FirebaseInstallationsApi.class);
when(installationsApiMock.getId()).thenReturn(Tasks.forResult("instanceId"));
idManager = new IdManager(getContext(), getContext().getPackageName(), installationsApiMock, DataCollectionArbiterTest.MOCK_ARBITER_ENABLED);
uuid = new CLSUUID(idManager);
}
use of com.google.firebase.installations.FirebaseInstallationsApi in project firebase-android-sdk by firebase.
the class CrashlyticsControllerTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
testContext = getContext();
FirebaseInstallationsApi installationsApiMock = mock(FirebaseInstallationsApi.class);
when(installationsApiMock.getId()).thenReturn(Tasks.forResult("instanceId"));
idManager = new IdManager(testContext, testContext.getPackageName(), installationsApiMock, DataCollectionArbiterTest.MOCK_ARBITER_ENABLED);
testFileStore = new FileStore(testContext);
Settings testSettings = new TestSettings(3);
mockSessionReportingCoordinator = mock(SessionReportingCoordinator.class);
mockDataCollectionArbiter = mock(DataCollectionArbiter.class);
when(mockDataCollectionArbiter.isAutomaticDataCollectionEnabled()).thenReturn(true);
testSettingsProvider = mock(SettingsProvider.class);
when(testSettingsProvider.getSettingsSync()).thenReturn(testSettings);
when(testSettingsProvider.getSettingsAsync()).thenReturn(Tasks.forResult(testSettings));
}
Aggregations