?>

Firebase Realtime Database + Google Drive Integrations

Appy Pie Connect allows you to automate multiple workflows between Firebase Realtime Database and Google Drive

About Firebase Realtime Database

Realtime Database Stores and sync app data in milliseconds

About Google Drive

Google Drive is one of the best file sync apps that let you store all of your files online alongside your Google Docs documents, and keep them synced with all of your devices.

Google Drive Integrations
Google Drive Alternatives

Connect the apps you use everyday and find your productivity super-powers.

  • Dropbox Dropbox

Best Firebase Realtime Database and Google Drive Integrations

  • Firebase Realtime Database Dropbox

    Google Drive + Dropbox

    Copy new Google Drive files in a specific folder to Dropbox Read More...
    When this happens...
    Firebase Realtime Database New File in Folder
     
    Then do this...
    Dropbox Upload File
    Integrate your Dropbox and Google Drive with Appy Pie Connect, and make your life easier. This Connect can save you a lot of time every day by helping you store and organize your important files in a systematized manner. Once you’ve set up this integration, whenever a file is added to Google Drive, we will copy that file to the designated folder in Dropbox.
    How It Works
    • Triggers when a new file is added in Google Drive
    • This Connect automatically copies that file to a designated Dropbox
    What You Need
    • A Google Drive account
    • A Dropbox account
  • Firebase Realtime Database Trello

    Google Drive + Trello

    Create Trello cards from new Google Drive files Read More...
    When this happens...
    Firebase Realtime Database New File in Folder
     
    Then do this...
    Trello Create Card
    Get more out of your Google Drive by connecting it to Trello. After setting this integration up, whenever a new file is saved in a chosen folder in your Google Drive, Appy Pie Connect will automatically create a card in Trello. With this Trello and Google Drive integration, you can make your team collaboration more efficient.
    How It Works
    • Triggers every time a new file is saved to a chosen folder in your Google Drive
    • Appy Pie Connect automatically creates a new card in Trello
    What You Need
    • A Google account
    • A Trello account
  • Firebase Realtime Database Dropbox

    Google Drive + Dropbox

    Copy new Google Drive files in any folder to Dropbox Read More...
    When this happens...
    Firebase Realtime Database New File
     
    Then do this...
    Dropbox Upload File
    Setting up integration between your Dropbox and Google Drive can get you many extra productive hours every single day. After setting up this integration, whenever a new file is added on your Google Drive, Appy Pie Connect will copy that file to any folder in Dropbox.
    How This Integration Works
    • Triggers when a new file is added to Google Drive
    • Appy Pie Connect will automatically copy that file to any folder in Dropbox
    What Is Needed for This Integration
    • A Google Drive account
    • A Dropbox account
  • Firebase Realtime Database Google Sheets

    Google Drive + Google Sheets

    Add rows on Google Sheets spreadsheet when a file is added in a Google Drive folder Read More...
    When this happens...
    Firebase Realtime Database New File in Folder
     
    Then do this...
    Google Sheets Create Spreadsheet Row
    To keep your records straight, you might need a list of every new file added to a Google Drive folder. Set up this integration to watch your Google Drive folder and create a Google Sheets spreadsheet row when a new file is added. Once this Google Drive – Google Spreadsheet integration is all set up, whenever a new file is added in a Google Drive Folder, Appy Pie Connect automatically adds a new row on Google Sheets spreadsheet, keeping you aware of additions in your Google Drive. Note: This Connect will not generate Google Sheets spreadsheet rows for existing files in your Google Drive folder, but only the new files you receive after this integration has been setup.
    How It Works
    • A file is added to a Google Drive folder
    • Appy Pie Connect creates a Google Sheets spreadsheet row
    What You Need
    • A Google Account (with Google Sheets and Google Drive access)
  • Firebase Realtime Database Google Calendar

    Google Drive + Google Calendar

    Generate new Google Calendar events for new files on Google Drive Read More...
    When this happens...
    Firebase Realtime Database New File
     
    Then do this...
    Google Calendar Create Detailed Event
    With Google Calendar – Google Drive automation from Appy Pie Connect, you can now easily streamline your workflow, without any hassle. Once this integration is active, whenever any new file is uploaded to your chosen Google Drive folder, Appy Pie Connect will automatically create an event on Google Calendar for it.
    How It Works
    • A new file is added to Google Drive
    • Appy Pie Connect automatically creates a new detailed event on Google Calendar
    What You Need
    • A Google account with an access to Google Drive and Google Calendar
  • Firebase Realtime Database Google Calendar

    {{item.triggerAppName}} + {{item.actionAppName}}

    {{item.message}} Read More...
    When this happens...
    Firebase Realtime Database {{item.triggerTitle}}
     
    Then do this...
    {{item.actionAppImage}} {{item.actionTitle}}
Connect Firebase Realtime Database + Google Drive in easier way

It's easy to connect Firebase Realtime Database + Google Drive without coding knowledge. Start creating your own business flow.

    Triggers
  • Edit or Updated Child Object in Firebase Realtime Database

    Triggers on updation of a child object in firebase realtime database.

  • New Child Object in a Firebase Realtime Database

    New Child Object in a Firebase Realtime Database

  • New File

    Triggers whenever a new file is added to any of the folders.

  • New File in Folder

    Triggers whenever a new file is directly added to a specific folder.(but doesn't trigger when a file is added to the subfolders)

    Actions
  • Create or Replace Firebase Realtime Database Record

    Creates or replaces a child object within your Firebase Realtime Database.

  • Create File from Text

    Create a new file from plain text.

  • Create Folder

    Create a new folder.

  • Upload File

    An existing file is copied to Google Drive from a different service.

How Firebase Realtime Database & Google Drive Integrations Work

  1. Step 1: Choose Firebase Realtime Database as a trigger app and Select "Trigger" from the Triggers List.

    (30 seconds)

  2. Step 2: Authenticate Firebase Realtime Database with Appy Pie Connect.

    (10 seconds)

  3. Step 3: Select Google Drive as an action app.

    (30 seconds)

  4. Step 4: Pick desired action for the selected trigger.

    (10 seconds)

  5. Step 5: Authenticate Google Drive with Appy Pie Connect.

    (2 minutes)

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

Integration of Firebase Realtime Database and Google Drive

Firebase Realtime Database?

Firebase Realtime Database is a cloud-hosted database. It lets you store and sync data as key-value pairs in realtime. This means that the data you write to the database immediately reflects in the UI of your app, and vice versa.

Google Drive?

Google Drive is a free space where you can store all types of files. It is a cloud storage service by Google and it allows users to save documents, images, videos, and other files online. With Google Drive, you can easily share your files with friends or workgroups. You can also use Google Drive to back up your files.

Integration of Firebase Realtime Database and Google Drive

In this section, I will talk about how we can integrate Firebase Realtime Database with Google Drive. We will use React to accomplish this integration.

First of all, we need an index.html file inside the src fpder for our React App. In this file, we will include all the required scripts like react.js, firebase.js and googleapis.js. After including all the scripts, we will create a FirebaseApp variable because we will need to use it in our React component later. We will get a Firebase App instance by calling the Firebase constructor and passing it our FirebaseApp variable as a parameter.

Now that we have a Firebase app instance, we can use the initApp method provided by Firebase SDK to initialize our app with a reference to our database URL such that we can access it later on in our app. This initialization will return a promise which when respved will give us an initial config object.

Next, we will include a login button to load the Google Sign-in popup so that the user can authenticate themselves before accessing their Google Drive files from our app. We will implement the logic for this button in our callback function which accepts a signInSuccessful parameter as its only argument. The signInSuccessful parameter argument will be true if the user has successfully signed in and false otherwise. If the user has signed in successfully, then we will show them a modal with a list of their files from Google Drive. After showing the modal, we will pass the signInSuccessful parameter to our openFileList function as an argument so that the openFileList function can update its state according to the value of signInSuccessful .

The openFileList function requires two other functions as arguments named openFileById and openFileByName . The openFileById function takes a fileId parameter whose value is set by calling getFileById on our config object returned earlier from the Firebase initApp method whenever the user clicks on a file from the Google Drive modal page. The openFileByName function takes a filename parameter whose value is set by calling getFileByName on our config object whenever the user clicks on a file from Google Drive via the Google Drive modal page.

Both getFileById and getFileByName methods return promises which are respved once their respective request has completed. If a request fails for any reason, then its promise is rejected with an appropriate error message. Once these requests complete successfully or fail, they call their respective success or error callback functions with 2 parameters sent from the server. a responseText and responseCode . The responseText contains the contents of the requested file’s JSON representation while responseCode contains any HTTP status codes returned by the server (for example 200 or 404. In our openFileById and openFileByName callback functions, we are just logging out these response parameters so that we can understand what’s going on in them when they are called from our app in future. We are also setting the loadedFile variable to true so that we can show the file’s name in our modal later on when it is loaded by Firebase Storage SDK.

Lastly, we are defining our HomePage React component class which extends React Component . In the constructor, we pass in an array of file names and chooseRandomFile as props so that we can show these files’ names on our HomePage React component class’s render function. We also pass in an updateFirebaseStorageStatus(. function as well as an onClick event handler for each file name such that they can call their respective callback functions when clicked on. The updateFirebaseStorageStatus(. function takes a status parameter whose value is either loading or loaded , depending on whether or not the requested file is currently being loaded by Firebase Storage SDK. We use this value to contrp the values of two different states of our component. loading and loaded . The loading state gives focus to the button which calls getFileByName while the loaded state gives focus to the button which calls openFileById . By using these two states, you allow your users to modify their actions based on whether or not they think that their action will result in an immediate result or if they should wait until something happens first before acting upon their intentions. For example, if they click on a video file from Google Drive when your app is in its loading state then they will not be able to play it since it isn’t fully loaded yet; however, if they click on a video file from Google Drive when your app is in its loaded state then they will be able to play it since it will be fully loaded already at that point in time after pressing play . The onClick event handler gets passed 3 arguments. an event , fileName , and index respectively. When a fileName is clicked on, we call getFileByName passing it the name of that file name as well as an empty array because its callback function expects an array of responseText s instead of just one responseText . Then, we append the responseText s returned by getFileByName into an array named filesOfUser and then send that array through props to HomePage React component class’s render function so that it can show all of those individual files’ names within its render function. Likewise, when a index is clicked on, we call openFileById passing it that particular index as well as an empty array because its callback function expects an array of responseText s instead of just one responseText . Then, we append the responseText s returned by openFileById into an array named responses array and then send that array through props to HomePage React component class’s render function so that it can show all of those individual responseText s within its render function. Lastly, we call updateFirebaseStorageStatus passing in either loading or loaded depending on whether or not a particular responseText is from Firebase Storage SDK or not. Doing so allows us to keep track of whether or not there is currently something happening in Firebase Storage SDK with respect to any of these files’ data so that we can appropriately show this information to our users via updating our HomePage React component class’s state with whatever information we want them to see at any given moment in time. For example, if they click on a video file from Google Drive when your app is in its loading state then they will check back again once your app is in its loaded state since Firebase Storage SDK hasn’t finished uploading their video file yet; however, if they click on a video file from Google Drive when your app is in its loaded state then they could play it since Firebase Storage SDK has already finished uploading their video file by that time since it was fully loaded already at that point in time after pressing play .

After defining our HomePage React component class, we create an App component class which extends React Component . This App component class requires two other components. HomePage and FirebaseStorageInfo . We pass HomePage into App ‘s constructor as well as an updateFirebaseStorageStatus(. function as prop so that homePage ‘s updateFirebaseStorageStatus(. callback function can call updateFirebaseStorageStatus(. whenever needed. Similarly, we pass FirebaseStorageInfo into App ‘s constructor as well as an updateFirebaseStorageStatus(. function as prop so that fireBaseStorageInfo ‘s updateFirebaseStorageStatus(. callback function can call updateFirebaseStorageStatus(. whenever needed too. Lastly, we call HomePage ‘s render(. method in App ‘s render(. method so that HomePage ‘s render(. method returns whatever HomePage ‘s state looks like at any given moment in time based on what page is currently being rendered (loading or loaded . by App ‘s render(. method due to whatever reason (such as user clicking on a button etc..

After creating App , we create AppContainer React component class whose render(. method returns

The process to integrate Firebase Realtime Database and Google Drive 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.