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);
}
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);
}
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);
}
Aggregations