Algolia Search Firebase Extension not tracking firestore database collection after install - firebase

I have installed the Search with Algolia extension into my firebase project, but after configuring the correct collection path ('listings) and inputting the Algolia Index Name and Algolia Application id. the index in Algolia is not registering updates to the collection. I get the message of 'No Records Yet'.
I have followed the video on the Algolia website, and it is installed into the correct project on firebase.
When clicking the 'How this extension works' tab, the link takes me to the Firebase realtime Database tab, and asks me to create a database. I can't see it requiring this anywhere in the Algolia extension, as currently my database is using the Firestore Database.
Do I need to switch to using the realtime Database for the extension to work, or should it also work with the Firestore Database?
The path to the collection set in the Extension Configuration is listings, should it projectName? listings? listings is the collection name though.
EDIT:
So another answer is listed here Firestore / Algolia integration fail: API key problem
The 400 error was down to insufficent permissions relating to the API key. The Admin API key will work, but you are better off creating a new API key with the desired permissions.

The Firebase Extension works with Firestore, so you should be good there. For the collection, it should just be as it is named in Firestore, so a collection named listings should just be configured as listings.
Do you have a transform function enabled on this extension? Or is that field left blank? (not a space either -- as this field can accept spaces)
Do you see any errors if you examine the logs for the Extension's function? To check this, navigate to Firebase > Functions and select the project you have installed the extension into. On the row for the function named ext-firestore-algolia-search-executeIndexOperation, hover over the right-hand side and click the three vertical dots. Click View Logs in this drop-down.
Are there any errors here that may help narrow down the issue?

Related

Can't access uploaded files through Firebase storage on web

I'm trying to access/download files that have been uploaded to Firebase storage but I can't figure out how to. Some of the files have a create new access token button under the storage location which gives me a link to the file on the web. Unfortunately, this is only a few files and seems to only be ones uploaded from localhost?
I can't find any reference to this on the documentation, this should be achievable through the Firebase dashboard?
I've tried setting the access rules to allow reads in all cases which hasn't helped.
Thanks
In general, you're supposed to use getDownloadURL(), as shown in the documentation, from within your web or mobile app to generate a download URL for use within your app. Typically, the console is only used to revoke the tokens that enable to download of each file through that URL.
If that's not specifically what you're trying to do, perhaps you want to read up on other was to make data public in Cloud Storage. The Firebase console is not really the best mechanism to manage downloadable content.

Delete Firestore database from project

I have a firebase project and I added a Firestore database but I forgot to choose the right location. Since the location can not be modified after creating the database and the database is empty I would like to just delete it and create a new one with the correct location. Is this possible or do I need to create the whole project again?
Would appreciate help a lot.
Once a region is set for a project, it can't be changed. In the documentation it says:
Warning: Setting the location for one of the following services [Firestore, Storage, App Engine] also sets the location for the others. After you set your project's default GCP resource location, you cannot change it.
So, you will have to create a whole new project.

How To pull photo down and display it from firebase?

I am making a react native app with expo and firebase. I have uploaded photos to firebase successfully as a blob but want to be able to pull the photos down from firebase and display them to the user. I need to be able to display the user's profile photos whenever they log out or back into the app.
I am not finding any documentation in Expo/React Native/Firebase about downloading. I am only seeing docs on uploading and blobs.
Can anyone point me in the right direction? Is uploading the blob form of the photo and downloading it the correct way to save photos from a user's phone to the database?
These are the resources I have reviewed:
https://firebase.google.com/docs/storage/web/download-files
https://docs.expo.io/versions/latest/sdk/imagepicker/
https://github.com/expo/firebase-storage-upload-example/blob/master/App.js
https://forums.expo.io/t/uploading-images-without-react-native-fetch-blob/981/7
The Cloud Storage SDK from Firebase for JavaScript doesn't have any methods to directly download the bytes from a file.
The way to download the data is through the download URL. So you first get the download URL of the file you're interested in, and then download the data with for example an XMLHttpRequest (as shown in the example in the documentation), or with a similar method for your platform to download data from a URL. For expo the latter seems to be FileSystem.downloadAsync(...).

Is it possible to rename firebase database name?

We had created the multiple databases. Now, we need to rename the database that is used for testing purpose. So, Is it possible to rename check-12cc0-test database? Please check out the image below.
You can change your project name from here
I have it in Spanish, but at the right of project overview, project configuration you should see the pencil to edit your project name.
Note you can't change your database name since it's the ID of the project, you will need to create a new one and delete the one you have to change the database name. You can only change your children and keys inside your database main tree node.
Since the id of the project can't change, this is what Firebase tells to us about it:
ID of the project
It is the unique identifier of your Firebase project. You can find it in the project URL: https://console.firebase.google.com/project/<projectId>
Remember that for edit the nodes and keys you can't do it directly from Firebase, instead you should export your JSON Database and edit it, then reupload it, or do it programmatically.

Using Firebase Cloud Functions to Update Hosted File

I am building a site that is using Angular 4, Firebase, and Firebase Cloud Functions. What I am looking to do is when certain data is added to the database I want to add, remove, or update something in an RSS feed, sitemap, and JSON feed which are files hosted with Firebase Hosting.
Any suggestions on how to accomplish this or an alternative if it is not possible without manual updates and redeploys of the project?
There is currently no way to publish a new (or update a) file to Firebase Hosting based on a database (or other dynamic) trigger.
What is possible is to map a Cloud Function to a path on your site (e.g. /sitemap or /feed), generate the HTML in that Cloud Function, and then set caching headers on the result.

Resources