Search in sources :

Example 1 with FirebaseInstanceIdInternal

use of com.google.firebase.iid.internal.FirebaseInstanceIdInternal in project GreenHouse by utsanjan.

the class CrashlyticsRegistrar method buildCrashlytics.

/* JADX INFO: Access modifiers changed from: private */
public FirebaseCrashlytics buildCrashlytics(ComponentContainer container) {
    FirebaseApp app = (FirebaseApp) container.get(FirebaseApp.class);
    CrashlyticsNativeComponent nativeComponent = (CrashlyticsNativeComponent) container.get(CrashlyticsNativeComponent.class);
    AnalyticsConnector analyticsConnector = (AnalyticsConnector) container.get(AnalyticsConnector.class);
    FirebaseInstanceIdInternal instanceId = (FirebaseInstanceIdInternal) container.getProvider(FirebaseInstanceIdInternal.class).get();
    return FirebaseCrashlytics.init(app, instanceId, nativeComponent, analyticsConnector);
}
Also used : FirebaseInstanceIdInternal(com.google.firebase.iid.internal.FirebaseInstanceIdInternal) FirebaseApp(com.google.firebase.FirebaseApp) CrashlyticsNativeComponent(com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent) AnalyticsConnector(com.google.firebase.analytics.connector.AnalyticsConnector)

Example 2 with FirebaseInstanceIdInternal

use of com.google.firebase.iid.internal.FirebaseInstanceIdInternal in project firebase-android-sdk by firebase.

the class FirebaseMessagingRoboTest method getToken_withFiid.

@Test
public void getToken_withFiid() throws Exception {
    resetForTokenTests();
    FirebaseInstanceIdInternal mockFiid = mock(FirebaseInstanceIdInternal.class);
    GmsRpc mockGmsRpc = mock(GmsRpc.class);
    FirebaseMessaging messaging = new FirebaseMessaging(FirebaseApp.getInstance(), mockFiid, mock(FirebaseInstallationsApi.class), /* transportFactory= */
    null, mock(Subscriber.class), mock(Metadata.class), mockGmsRpc, Runnable::run, Runnable::run, Runnable::run);
    when(mockFiid.getTokenTask()).thenReturn(Tasks.forResult("fake_token"));
    Task<String> getTokenTask = messaging.getToken();
    ShadowLooper.idleMainLooper();
    assertThat(Tasks.await(getTokenTask, 5, SECONDS)).isEqualTo("fake_token");
    verifyNoMoreInteractions(mockGmsRpc);
}
Also used : FirebaseInstanceIdInternal(com.google.firebase.iid.internal.FirebaseInstanceIdInternal) Subscriber(com.google.firebase.events.Subscriber) FirebaseInstallationsApi(com.google.firebase.installations.FirebaseInstallationsApi) Test(org.junit.Test)

Example 3 with FirebaseInstanceIdInternal

use of com.google.firebase.iid.internal.FirebaseInstanceIdInternal in project firebase-android-sdk by firebase.

the class FirebaseMessagingRoboTest method deleteToken_withFiid.

@Test
public void deleteToken_withFiid() throws Exception {
    resetForTokenTests();
    FirebaseInstanceIdInternal mockFiid = mock(FirebaseInstanceIdInternal.class);
    GmsRpc mockGmsRpc = mock(GmsRpc.class);
    FirebaseMessaging messaging = new FirebaseMessaging(FirebaseApp.getInstance(), mockFiid, mock(FirebaseInstallationsApi.class), /* transportFactory= */
    null, mock(Subscriber.class), mock(Metadata.class), mockGmsRpc, Runnable::run, Runnable::run, Runnable::run);
    Task<Void> deleteTokenTask = messaging.deleteToken();
    ShadowLooper.idleMainLooper();
    Tasks.await(deleteTokenTask, 5, SECONDS);
    verify(mockFiid).deleteToken(FirebaseIidRoboTestHelper.SENDER_ID, FirebaseMessaging.INSTANCE_ID_SCOPE);
    verifyNoMoreInteractions(mockGmsRpc);
}
Also used : FirebaseInstanceIdInternal(com.google.firebase.iid.internal.FirebaseInstanceIdInternal) Subscriber(com.google.firebase.events.Subscriber) FirebaseInstallationsApi(com.google.firebase.installations.FirebaseInstallationsApi) Test(org.junit.Test)

Aggregations

FirebaseInstanceIdInternal (com.google.firebase.iid.internal.FirebaseInstanceIdInternal)3 Subscriber (com.google.firebase.events.Subscriber)2 FirebaseInstallationsApi (com.google.firebase.installations.FirebaseInstallationsApi)2 Test (org.junit.Test)2 FirebaseApp (com.google.firebase.FirebaseApp)1 AnalyticsConnector (com.google.firebase.analytics.connector.AnalyticsConnector)1 CrashlyticsNativeComponent (com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent)1