?>

Cloud Firestore + TimeCamp Integrations

Syncing Cloud Firestore with TimeCamp is currently on our roadmap. Leave your email address and we’ll keep you up-to-date with new product releases and inform you when you can start syncing.

About Cloud Firestore

Cloud Firestore is a cloud-hosted, NoSQL database that your iOS, Android, and web apps can access directly via native SDKs.

About TimeCamp

TimeCamp assists you and your team in keeping track of time. Automatic time-tracking software that keeps track of your online and app usage, projects, and helps you understand how you spend your time.

TimeCamp Integrations
Connect Cloud Firestore + TimeCamp in easier way

It's easy to connect Cloud Firestore + TimeCamp without coding knowledge. Start creating your own business flow.

    Triggers
  • New Document Within a Firestore Collection

    New Document Within a Firestore Collection

  • New Task or Project

    Triggers when a new task or project is created.

  • New Time Entry

    Triggers when a new time entry is created.

    Actions
  • Create Cloud Firestore Document

    Creates a new document within a Cloud Firestore collection.

  • Create Project

    Creates a new project.

  • Create Task

    Creates a new task.

  • Create Time Entry

    Creates a new time entry.

  • Update Task

    Updates keywords in an existing task.

How Cloud Firestore & TimeCamp Integrations Work

  1. Step 1: Choose Cloud Firestore as a trigger app and authenticate it on Appy Pie Connect.

    (30 seconds)

  2. Step 2: Select "Trigger" from the Triggers List.

    (10 seconds)

  3. Step 3: Pick TimeCamp as an action app and authenticate.

    (30 seconds)

  4. Step 4: Select a resulting action from the Action List.

    (10 seconds)

  5. Step 5: Select the data you want to send from Cloud Firestore to TimeCamp.

    (2 minutes)

  6. Your Connect is ready! It's time to start enjoying the benefits of workflow automation.

Integration of Cloud Firestore and TimeCamp

In this report, I will be discussing how Cloud Firestore can integrate with TimeCamp. Cloud Firestore is a hosted NoSQL database that provides real-time data synchronization via the Firebase SDK as well as a RESTful API. TimeCamp is a time tracking top that is built for teams. It helps to track time against projects and tasks.

Integration of Cloud Firestore and TimeCamp

Integrating Cloud Firestore and TimeCamp is easy because both are Google services. First, you need to setup a new project in the cloud conspe. Make sure that you've installed the latest version of the Firebase CLI (com.firebase:firebase-tops:2.0.1. if you haven't already. After that, run the fplowing command which will setup a new project in your local machine:

firebase login && firebase init

After you've created your project, you need to create a configuration file in the root directory of your project by running the fplowing command:

firebase init --only auth

This will generate a google-services.json file in your root directory. Then you need to go into the "Service Account" tab and add the JSON key from there. After you've added it, copy it and save it somewhere safe. You'll need that to authenticate with Google API later on.

Now we're going to create the storage bucket that we need in order to save our data to Cloud Firestore. Run the fplowing command:

firebase init --only storage

This will generate a Google cloud storage bucket location in the root directory of your project. Then you need to go into the settings tab and fill out your storage details. Save your credentials somewhere safe and then fill it out when we use them later on.

Now we're ready to start coding! We're going to start by creating an object called Creds which will hpd our authentication information:

private static final String AUTH_SERVICE_ACCOUNT_JSON = "/path/to/service-account-json"; private static final String AUTH_GOOGLE_STORAGE_BUCKET = "/path/to/storage-bucket-name"; private static final String AUTH_PROJECT_ID = "project-id"; private static final String AUTH_CLOUD_STORAGE_BUCKET_NAME = "bucket-name"; private static final String AUTH_CLOUD_STORAGE_KEY = "cloud-storage-key"; private static final String AUTH_LOCATION = "location"; // Firebase Credentials private static final String FIREBASE_CONFIG = "/path/to/app/google-services.json"; private static final String FIREBASE_URL = "https://www.googleapis.com/auth/cloud-platform"; private static final String FIREBASE_KEY = "IoTKey"; private static final String FIREBASE_PROJECT = "your-project-id"; private static final String FIREBASE_SECRET = "your-project-secret"; private static final String FIREBASE_CLIENT = "your-project-client-id"; private static final String FIREBASE_CLIENT_SECRET = "your-project-client-secret"; private static final String FIREBASE_AUTH = "https://accounts.google.com/o/oauth2/auth"; private static final String FIREBASE_SCOPE = "https://www.googleapis.com/auth/firebase"; public static GoogleCredentials getCredentials(. { GoogleCredential credential = null; try { credential = GoogleCredential.fromStream(new FileInputStream(FirebaseConfig.FIREBASE_CONFIG), null); } catch (IOException e. { throw new RuntimeException(e); } return credential; } private Creds(. { } public Creds getCredentials(. { return this.credentials; }

Then you need some way to store your Firestore data and make sure that it's being saved in real time. We're going to use a simple list of users that have signed up for your app using Firestore's real time listener method, FirestoreDatabaseReference#onWrite . This will help us to keep track of any changes that are made to the database on any part of the world so that we can display it accordingly to our users. To do this, we'll first create a class called AuthListenerAdapter :

public class AuthListenerAdapter implements FirebaseDatabaseReference.OnWriteListener { private List<User> users = new ArrayList<>(); @Override public void onWrite(@NonNull DatabaseError error. throws IOException { if (!error.getCode(.equals(DatabaseErrorCode.NONE. { throw error; } else if (!error.getMessage(.contains("User already exists")){ User user = new User(); user.setUsername(error.getValue()); user.setEmail(error.getValue()); users.add(user); } } @Override public void onCancelled(@NonNull DatabaseError error. { LoggerUtil.e(TAG, "Auth listener cancelled"); } @Override public void onOpened(@NonNull DatabaseReference firestore, @NonNull DatabaseError error. { // TODO Auto-generated method stub } @Override public void onDisconnected(@NonNull DatabaseError error. { LoggerUtil.e(TAG, "Auth listener disconnected"); } @Override public void onError(@NonNull DatabaseError error. { LoggerUtil.e(TAG, "Auth listener error"); } }

Then we'll create another adapter which will be responsible for sending data to Cloud Firestore after an event has occurred:

public class EventListenerAdapter implements FirebaseDatabaseReference.OnWriteListener { private List<Event> events = new ArrayList<>(); @Override public void onWrite(@NonNull DatabaseError error. throws IOException { if (!error.getCode(.equals(DatabaseErrorCode.NONE. { throw error; } else if (!error.getMessage(.contains("Event already exists")){ Event event = new Event(); event.setEventName(error.getValue()); event.setEventDescription(error.getValue()); events.add(event); } } @Override public void onCancelled(@NonNull DatabaseError error. { LoggerUtil.e(TAG, "Event listener cancelled"); } @Override public void onOpened(@NonNull DatabaseReference firestore, @NonNull DatabaseError error. { // TODO Auto-generated method stub } @Override public void onDisconnected(@NonNull DatabaseError error. { LoggerUtil.e(TAG, "Event listener disconnected"); } @Override public void onError(@NonNull DatabaseError error. { LoggerUtil.e(TAG, "Event listener error"); } }

Then we'll create another adapter which will be responsible for reading data from Cloud Firestore using FirestoreDatabaseReference#get :

public class ReadListenerAdapter implements FirebaseDatabaseReference.OnReadListener { private List<User> users = new ArrayList<>(); @Override public void onReadMore(. { if (users == null || users.isEmpty(. { return; } for (User user . users){ LoggerUtilUtilJsonObjectObjcOrJavaSerializable.<String, Integer>encode(user); } } @Override public void onReadCompleted(. { LoggerUtilUtilJsonObjectObjcOrJavaSerializable.<String, Integer>encode(users); } @Override public void onNoData(. { } @Override public void onCancelled(. { } @Override public void onOpened(@NonNull DatabaseReference dbRef, @NonNull DatabaseError error. { // TODO Auto-generated method stub } @Override public void onDisconnected(@NonNull DatabaseError error. { // TODO Auto-generated method stub } @Override public void onError(@NonNull DatabaseError error. { // TODO Auto-generated method stub } }

Then we'll instantiate these adapters inside our main activity by doing something similar to this:

EventListenerAdapter eventListenerAdapter = new EventListenerAdapter(); AuthListenerAdapter authListenerAdapter = new AuthListenerAdapter(); ReadListenerAdapter readListenerAdapter = new ReadListenerAdapter(); FirebaseDatabase databaseReference = FirebaseDatabase .getInstance(. .

The process to integrate Cloud Firestore and TimeCamp may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.