--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/dafa936d-676b-4761-96f4-9fdab8f47922%40googlegroups.com.
:authority: firestore.googleapis.com
:method: POST
:path: /google.firestore.v1.Firestore/Listen/channel?database={database}&VER=8&RID={rid}&X-HTTP-Session-Id=gsessionid&%24httpHeaders=X-Goog-Api-Client%3Agl-js%2F%20fire%2F7.5.0%0D%0A&zx=w2nvzzg08rob&t=1
[Parsed form data]
count: 1
ofs: 0
req0___data__: {
"database":"projects/{projectId}/databases/(default)",
"addTarget":{
"documents":
{
"documents": ["projects/{projectId}/databases/(default)/documents/public/AKoaGL7w6GxCCF97IVIP"]
},
"targetId":2
}
}
51[[0,["c","lyAOqbbp6su3UYBQD2dvQg","",8,12,30000]]]
POST https://firestore.googleapis.com/v1/projects/{projectID}/databases/(default)/documents:listen
[json body]
{ "addTarget": { "documents": [ "projects/sandbox-6b679/databases/(default)/documents/public/AKoaGL7w6GxCCF97IVIP" ] }}
[ { "error": { "code": 400, "message": "Invalid value (Object), ", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.rpc.BadRequest", "fieldViolations": [ { "description": "Invalid value (Object), " } ] } ] } }]
JS SDK uses gRPC streaming to receive real time updates. Here's the respective proto: https://github.com/firebase/firebase-js-sdk/blob/master/packages/firestore/src/protos/google/firestore/v1/firestore.proto#L148
On Tue, Dec 3, 2019 at 12:16 PM Samuel Elgozi <samu....@gmail.com> wrote:
Hi everyone,--About a month ago I wrote a light-weight "low level" SDK for Firestore. I got into the point in which only one feature is missing, which is real-time updates.The API used by the SDK's is not documented anywhere, until this point I've used the public REST API for all other features, but the real-time updates aren't part of it.I guess I can reverse engineer it as I did with my Storage and Auth SDKs, but this one seems harder.So can anyone here explain to me how it works?I do know that the current JS SDK uses polling, but I couldn't figure out what are the right arguments and the protocol.If there is another way(web socket) used by a different SDK that would be preferable(I only support modern browsers anyways)Side note: If you were wondering why I rebuilt the library then its because I needed my web app to be very fast and performant, so by rewriting it I managed to have all features with a bundle of about 5KB~ for Firestore,Storage is about 1.5KB~ and Auth is at about 1KB~ but not fully featured. And performance-wise it's in orders of magnitude faster and more memory efficient than the official ones.Thanks in advance!
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/dafa936d-676b-4761-96f4-9fdab8f47922%40googlegroups.com.