Search in sources :

Example 6 with FirebaseInstallationsApi

use of com.google.firebase.installations.FirebaseInstallationsApi in project firebase-android-sdk by firebase.

the class IdManagerTest method testGetIdExceptionalCase_doesNotRotateInstallId.

public void testGetIdExceptionalCase_doesNotRotateInstallId() {
    FirebaseInstallationsApi fis = mock(FirebaseInstallationsApi.class);
    final String expectedInstallId = "expectedInstallId";
    when(fis.getId()).thenReturn(Tasks.forException(new TimeoutException("Fetching id timed out.")));
    prefs.edit().putString(IdManager.PREFKEY_INSTALLATION_UUID, expectedInstallId).putString(IdManager.PREFKEY_FIREBASE_IID, "firebase-iid").apply();
    final IdManager idManager = new IdManager(getContext(), getContext().getPackageName(), fis, MOCK_ARBITER_ENABLED);
    final String actualInstallId = idManager.getCrashlyticsInstallId();
    assertNotNull(actualInstallId);
    assertEquals(expectedInstallId, actualInstallId);
}
Also used : FirebaseInstallationsApi(com.google.firebase.installations.FirebaseInstallationsApi) TimeoutException(java.util.concurrent.TimeoutException)

Example 7 with FirebaseInstallationsApi

use of com.google.firebase.installations.FirebaseInstallationsApi in project firebase-android-sdk by firebase.

the class CrashlyticsRegistrar method buildCrashlytics.

private FirebaseCrashlytics buildCrashlytics(ComponentContainer container) {
    FirebaseApp app = container.get(FirebaseApp.class);
    Deferred<CrashlyticsNativeComponent> nativeComponent = container.getDeferred(CrashlyticsNativeComponent.class);
    Deferred<AnalyticsConnector> analyticsConnector = container.getDeferred(AnalyticsConnector.class);
    FirebaseInstallationsApi firebaseInstallations = container.get(FirebaseInstallationsApi.class);
    return FirebaseCrashlytics.init(app, firebaseInstallations, nativeComponent, analyticsConnector);
}
Also used : FirebaseInstallationsApi(com.google.firebase.installations.FirebaseInstallationsApi) FirebaseApp(com.google.firebase.FirebaseApp) CrashlyticsNativeComponent(com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent) AnalyticsConnector(com.google.firebase.analytics.connector.AnalyticsConnector)

Aggregations

FirebaseInstallationsApi (com.google.firebase.installations.FirebaseInstallationsApi)7 FirebaseApp (com.google.firebase.FirebaseApp)3 Application (android.app.Application)2 AnalyticsConnector (com.google.firebase.analytics.connector.AnalyticsConnector)2 Context (android.content.Context)1 FirebaseAppDistribution (com.google.firebase.appdistribution.FirebaseAppDistribution)1 CrashlyticsNativeComponent (com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent)1 FileStore (com.google.firebase.crashlytics.internal.persistence.FileStore)1 Settings (com.google.firebase.crashlytics.internal.settings.Settings)1 SettingsProvider (com.google.firebase.crashlytics.internal.settings.SettingsProvider)1 TestSettings (com.google.firebase.crashlytics.internal.settings.TestSettings)1 Subscriber (com.google.firebase.events.Subscriber)1 AbtIntegrationHelper (com.google.firebase.inappmessaging.internal.AbtIntegrationHelper)1 ProgramaticContextualTriggers (com.google.firebase.inappmessaging.internal.ProgramaticContextualTriggers)1 AppComponent (com.google.firebase.inappmessaging.internal.injection.components.AppComponent)1 DaggerAppComponent (com.google.firebase.inappmessaging.internal.injection.components.DaggerAppComponent)1 DaggerUniversalComponent (com.google.firebase.inappmessaging.internal.injection.components.DaggerUniversalComponent)1 UniversalComponent (com.google.firebase.inappmessaging.internal.injection.components.UniversalComponent)1 AnalyticsEventsModule (com.google.firebase.inappmessaging.internal.injection.modules.AnalyticsEventsModule)1 ApiClientModule (com.google.firebase.inappmessaging.internal.injection.modules.ApiClientModule)1