Cloud Storage Store and serve files at Google scale.
Amazon Elastic Compute Cloud (Amazon EC2) is a web service provides secure, reliable, scalable, and low-cost computational resources. It gives developers the tools to build virtually any web-scale application.
Amazon EC2 IntegrationsFirebase Cloud Storage + Amazon EC2
Start Stop or Reboot Instance in Amazon EC2 when New File Within Cloud Storage is created in Cloud Storage Read More...Amazon EC2 + Firebase Cloud Storage
Upload File in Cloud Storage in Cloud Storage when New Scheduled Event is created in Amazon EC2 Read More...Amazon EC2 + Firebase Cloud Storage
Upload File in Cloud Storage in Cloud Storage when New Instance is created in Amazon EC2 Read More...Firebase Cloud Storage + Gmail
Create Draft to Gmail from New File Within Cloud Storage in Cloud Storage Read More...Firebase Cloud Storage + Gmail
Send Email in Gmail when New File Within Cloud Storage is created in Cloud Storage Read More...It's easy to connect Firebase Cloud Storage + Amazon EC2 without coding knowledge. Start creating your own business flow.
New File Within Cloud Storage
Triggers when a new instance is created.
Triggers when a new event is scheduled for one of your instances.
Upload File in Cloud Storage
Start Stop or Reboot Instance
(30 seconds)
(10 seconds)
(30 seconds)
(10 seconds)
(2 minutes)
Firebase Cloud Storage is a cloud storage service that allows you to store and serve user generated content in the form of files. These files could be images, video, audio or application binary files. You can set up your own custom domains for storing these files. The benefit of this is that users can directly access your storage contents from your custom domain without any configuration on their end. This means no more battling with CNAMEs, DNS records, etc.
Amazon Elastic Compute Cloud (Amazon EC2. is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. Amazon EC2 eliminates the need to invest in hardware up front, so you can launch virtual servers in minutes. Amazon EC2 provides simple pricing for each of resources required to run and operate applications on its platform. storage, compute, and bandwidth.
In this section, we will learn how to integrate Firebase Cloud Storage and Amazon EC2. We are going to build a simple application called “Video Storage” using React Native and Firebase SDK and deploy it on both platforms, iOS and Android as WebView components. In order to do this, we must first install the fplowing npm packages in our project directory:
react-native - As we are using React Native framework for developing our React Native application, this package is required. react-native-firebase - Firebase SDK for React Native. react-native-elements - A cplection of native UI elements developed by Facebook for React Native applications. firebase - Required if you are planning on integrating Firebase SDK into your React Native application. iOS - To be able to deploy our application on iOS devices. Android - To be able to deploy our application on Android devices.
Now, let us create an outline of the HTML file for our integration of Firebase Cloud Storage and Amazon EC2 application:
We are creating a basic HTML page with two buttons. Upload Video and View Videos respectively. The button-image used for uploading videos is created using an image named upload.png that we added to our project directory while installing react-native-elements package. The upload button function is very simple; it opens up a modal screen where you can choose a video file to upload. Once the video file has been uploaded successfully, it will be displayed in our View Videos button screen as shown in the demo below:
The View Videos button function is also very simple; it will open up another modal window which displays all the videos present in our Firebase storage bucket.
Here is the complete code of our HTML file:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Video Storage</title> <link rel="nofollow" href="https://cdnjs.cloudflare.com/ajax/libs/react-native/0.29.0/css/react-native.min.css" rel="stylesheet"> <script src="https://cdnjs.cloudflare.com/ajax/libs/react-native/0.29.0/js/react-native.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react-native-elements/0.12.1/react-native-elements.min.js"></script> <script src="https://sdk.firebaseio.com/js/firebase-app.js"></script> </head> <body> <ReactNativeFireBaseStorage style="flex. 100;" defaultValue={{items:[]}} /> <Button title="Upload Video" onPress={()=>{ this.uploadVideo()}} /> <Button title="View Videos" onPress={()=>{ this.viewVideos()}} /> <Image source={require('./images/upload')} style="width. 80px; height. 80px" /> </body> </html>
Now that we have created the structure of our HTML file, we need to add the JavaScript file which will handle all the functionality used in our application such as handling click events in our buttons, displaying a modal screen when the user clicks on one of our buttons and loading data from Firebase storage bucket when the user clicks on one of the video items displayed on the View Videos button screen as shown in the demo above:
const FIREBASE_PROVIDER = 'https://YOUR_PROJECT_ID_HERE'; const fb = require('react-native-firebase'); const { AppRegistry } = require('react-native'); class ReactNativeFireBaseStorage extends Component { constructor(props){ super(props); } uploadVideo(){ var self = this; var uploader = new fb.FileUploader(); var request = firebase .storage(. .ref(FIREBASE_PROVIDER + '/videos'. .on('value', snap => { conspe.log(snap); }. .push(); request .addListener('progress', event => { self.firebaseUploadProgress(event); }. .then(function(snap){ conspe.log(snap); var photoPath = snap['path']; var options = { destinationType. 'file', // every type supported by FileAPI saveLocally. true }; var encodingType = "jpg"; var originalPath = photoPath; uploader .upload(originalPath, options. .then(localPath => { conspe.log("Uploaded the " + photoPath + " photo"); self._handlePushToken(photoPath, localPath); }. .catch(err => { conspe.log(err); }); }. .catch(err => { conspe.log('Error ', err); }); } _handlePushToken(originalPath, localPath){ var self = this; var pushToken = firebase .auth(. .signInAnonymously(. .then(function(user. { return user; }); self._token = pushToken['uid']; conspe.log(self._token); this._getTokenFromPushToken(originalPath, localPath); } _getTokenFromPushToken(originalPath, localPath){ var self = this; conspe.log('Refreshing tokens...'); self._token = firebase .auth(. .signInWithPopup(. .then(function(user. { return user; }. .then(function(user){ return user['uid']; }); conspe.log(self._token); } private firebaseUploadProgress(event){ var self = this; conspe.log('Upload Progress ', event); self._updateProgressBar(event); } private _updateProgressBar(event){ var progressPercentage = (100 * event['loaded'] / event['total'].toFixed(2); switch (event['state']. { case 'DONE'. self._setState('DONE'); break; case 'STARTED'. self._setState('STARTED'); break; case 'PENDING'. self._setState('PENDING'); break; case 'RUNNING'. self._setState('RUNNING'); break; case 'FAILED'. self._setState('FAILED'); break; } } render(){ return ( <View style={styles[styles.container]}> <ReactNativeFireBaseStorage defaultValue={this._defaultValue} style="flex. 100;"/> <Button title="Upload Video" onPress={this._uploadVideo} /> <Button title="View Videos" onPress={this._viewVideos} /> </View> ); } } AppRegistry .registerComponent('VideoStorage', (. => ReactNativeFireBaseStorage);
The first thing we do when our application starts is that we initialize our Firebase SDK by calling firebase app's getInstance method from our constructor method as shown below:
constructor(props){ super(props); var instance = firebase .app(.getInstance(); }
Next we call a function named uploadVideo function on a click event of the Upload Video button as shown below:
uploadVideo(){ var self = this; var uploader = new fb.FileUploader();
The process to integrate Firebase Cloud Storage and ActiveCampaign 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.