use of com.google.firebase.FirebaseOptions in project geofire-java by firebase.
the class GeoFireTestingRule method starting.
@Override
public void starting(Description description) {
if (FirebaseApp.getApps().isEmpty()) {
final GoogleCredentials credentials;
try {
credentials = GoogleCredentials.fromStream(new FileInputStream(SERVICE_ACCOUNT_CREDENTIALS));
} catch (IOException e) {
throw new RuntimeException(e);
}
FirebaseOptions firebaseOptions = new FirebaseOptions.Builder().setDatabaseUrl(databaseUrl).setCredentials(credentials).build();
FirebaseApp.initializeApp(firebaseOptions);
System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
}
this.databaseReference = FirebaseDatabase.getInstance().getReferenceFromUrl(databaseUrl);
}
use of com.google.firebase.FirebaseOptions in project OneSignal-Android-SDK by OneSignal.
the class PushRegistratorFCM method initFirebaseApp.
private void initFirebaseApp(String senderId) {
if (firebaseApp != null)
return;
FirebaseOptions firebaseOptions = new FirebaseOptions.Builder().setGcmSenderId(senderId).setApplicationId(params.appId).setApiKey(params.apiKey).setProjectId(params.projectId).build();
firebaseApp = FirebaseApp.initializeApp(context, firebaseOptions, FCM_APP_NAME);
}
Aggregations