Firebase Integration

Hello.
Is there a way to integrate with Firebase?
Mainly I’m interested in Firebase Auth and Firebase Cloud Messaging.

1 Like

Currently there’s no built-in integration – if you can access everything via direct HTTP API calls, you could build your own set of flow functions by just wrapping the HTTP request node and giving it the correct input/output schemas.

That said, we’ve discussed bringing Firebase in as a first-class citizen, but it’s not yet planned for a specific point in the roadmap.

1 Like

If I can upvote for Firebase integration, count me in.

Being able to use their Auth, Databases, Storage, Cloud Messages and Dynamic Links, with the simplicty and logic of AppGyver would be a perfect combo in my opinion!!

4 Likes

Yup – feel free to post a feature request to https://tracker.appgyver.com so others can upvote too!

1 Like

hi Harri,

I have looked all over for this error on appgyver but can’t find info as to what the error relates to.
Error: TypeError: Preflight response is not successful

Resource settings for GET (all)

Resource URL: https://ordering-app-bc3ad.firebaseio.com
Relative path: /orders

please can you let me know what i am doing wrong.

i get this when connecting to firebase.

Sorry for taking so long to respond! This seems like a CORS issue; you need to configure the right headers for your Firebase resource.

From a quick Google search for firebase "preflight response is not successful", I found these links that might be helpful:


Hello @Ashley_Mclean did you manage to integrate?

I love Firebase but i use HTTP Request flows with it since i use PATCH requests extensively.

Hi @JOHN_WORSHAM , could you please provide a brief overview of how you used the HTTP request component for a PATCH request to Firebase?

I’ve set up the flow function with the following JSON/formula:

My problem is that although I can update one object in the document using this method, I also end up deleting all the other data in the document (as described here: Saving Data  |  Firebase - "Note that trying to update objects by writing objects with the paths included will result in different behavior… ")

How did you get around that?

Yes its because you are setting that whole request body with the entire json object full of empty fields.

In other words all you should be putting in the Request Body is the currentUser.id variable. Your URL should be the full path all the way down that object tree where currentUser.id goes. Dont firget to append the “.json” at the end of the URL

edit: I just noticed you have an array in there. This looks more complicated than I first thought, so I’ll have to think more about this one…
But I think what may be happening is your URL isnt getting set deep enough in your data tree, and so this is just replacing (Patching) all of your data with this entire json object.

1 Like

Thanks so much for getting back to me, John! I’ve been trying to put together the correct URL more or less since you posted your initial response, so I’m strangely relieved to see it’s more complicated than it looked at first…!

So far, I’ve gathered that the path to the object is as follows: [resourceURL]/[relativePath]/[documentID]

…with the following items nested in the individual document:
feedback->mapValue->fields->effective->arrayValue->values

Values is the array (I hope - I’m new to all this), within which I’m listing each piece of positive feedback (i.e: ‘effective’) under mapped values (score, text, user).

I’ll be honest: I have no idea how to go about constructing the URL to reach the array object. As per your initial response, I guess that’s the first step…?

My next concern after that, I imagine, will be to worry about whether or not every PATCH request going forward will simply replace all the items in the array (rather than just updating the array to include the new data without deleting anything else).

Further thoughts greatly appreciated…

If you could take a screenshot of your Firebase data tree so I can get a clearer image of what you are trying to Patch it might help me figure this out…

Ah yes, I suppose that would be easier! Here you go:

I’m trying to add new data to the ‘effective’ array under ‘feedback’. I considered changing the data structure on Firebase to have a sub-collection of ‘feedback’ documents but I would still like users to be able to edit existing documents, so I need to figure out a way of getting PATCH to work.

So you are going to have to set your URL to go all the way to “…/effective/arrayValue/values[index].json”

Your Request Body should be nothing more than the data/value of that array index, which appears to be this Object data:
Capture

Because all you are wanting to Patch is just what exists at that array index, correct?

Or if you wanted to Patch the whole array, then you could back your URL up one level to:
“…/effective/arrayValue.json"

and put your whole List of Objects (array variable) as the Request Body

No dice. Threw a 400 error.

Here’s the URL:

And the request body:

Hold on let me examine that closer. Your URL is messed up for sure though…

I need to see exactly what it looks like from Firebase. Screenshot like this…
Capture

Notice how my arrays are saved in a Numbered list

Because basically the end of your URL should be like this if you are writing a List of Objects array to Firebase:

“…/effective/arrayValue/values/” + STRING(index) + “.json”

and to this URL you send your object:
Capture

Thanks for bearing with me, John. Here’s the above-referenced document as it appears in Firebase: