Firebase and Server-side Swift

1,421 views
Skip to first unread message

miamiHeat4life

unread,
Jan 16, 2017, 3:02:01 PM1/16/17
to Firebase Google Group
Hi,

My team is developing an application that will require a decent amount of server side processing, hence, we will need to develop an App Server to connect to Firebase.

Ideally, we would like to do this in Swift and therefore evaluating Vapor and Perfect. However, so far it appears there are compatibility issues (e.g. no Firebase support of OSX). Thus, it appears my only option right now is using the REST api ) to connect (e.g. curl , http) with Firebase from Vapor / Perfect server. I hesitate to use this since its my understanding that if we do this, we loose all the real-time / offline features that Firebase SDKs provide and thus less appealing to use Firebase. 

Is this correct assumption? Are there any alternatives (besides coding the server in java / javascript / etc)? 

Thanks

Jacob Wenger

unread,
Jan 17, 2017, 2:57:50 PM1/17/17
to fireba...@googlegroups.com
Hey there,

You are correct that your only option to use Firebase in server-side Swift is to use the REST API. Some people on our team are kicking around the idea of an Swift SDK which works on the server-side, but currently there are no concrete plans to create that. The REST API definitely requires more effort than our client libraries (handling retries, latency compensation, etc.), but you can still get realtime streaming through the REST streaming API.

Cheers,
Jacob

--
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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b8f2b4fe-5834-4e93-a6a2-9e9c54bbdf05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

miamiHeat4life

unread,
Jan 18, 2017, 2:44:08 PM1/18/17
to Firebase Google Group
Thanks for the reply Jacob. 

Server-side swift would be great!

Andrea Ferrando

unread,
Feb 19, 2017, 4:55:29 PM2/19/17
to Firebase Google Group
Thanks Jacob for the useful answer.
Just a quick question: I couldn't find in the documentation if it is possible to observe events (like you can easily do in iOS with fir_reference.observe() ) with REST API.
Like miamiHeat4life, we are building our API with Vapor but we would like to integrate them with Firebase. No problem regarding normal REST requests, but what we would like to achieve is firebase sending "notification" to the server when something changed on a firebase database observed "table".
Is it possible?

Thanks
Regards
Andrea


On Tuesday, January 17, 2017 at 7:57:50 PM UTC, Jacob Wenger wrote:
Hey there,

You are correct that your only option to use Firebase in server-side Swift is to use the REST API. Some people on our team are kicking around the idea of an Swift SDK which works on the server-side, but currently there are no concrete plans to create that. The REST API definitely requires more effort than our client libraries (handling retries, latency compensation, etc.), but you can still get realtime streaming through the REST streaming API.

Cheers,
Jacob
On Mon, Jan 16, 2017 at 10:59 AM, miamiHeat4life <ezeq...@gmail.com> wrote:
Hi,

My team is developing an application that will require a decent amount of server side processing, hence, we will need to develop an App Server to connect to Firebase.

Ideally, we would like to do this in Swift and therefore evaluating Vapor and Perfect. However, so far it appears there are compatibility issues (e.g. no Firebase support of OSX). Thus, it appears my only option right now is using the REST api ) to connect (e.g. curl , http) with Firebase from Vapor / Perfect server. I hesitate to use this since its my understanding that if we do this, we loose all the real-time / offline features that Firebase SDKs provide and thus less appealing to use Firebase. 

Is this correct assumption? Are there any alternatives (besides coding the server in java / javascript / etc)? 

Thanks

--
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.

Jacob Wenger

unread,
Feb 21, 2017, 11:20:40 AM2/21/17
to fireba...@googlegroups.com
Hey Andrea,

Firebase REST endpoints support the EventSource / Server-Sent Events protocol, meaning you can in fact observe events instead of just poll for them. It is not as fully featured as the client SDKs' websocket-backed APIs, but it might suit your needs. See the Streaming from the REST API section for the full details.

Cheers,
Jacob

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

bogdan barbulescu

unread,
Aug 24, 2017, 12:23:02 PM8/24/17
to Firebase Google Group
Hi, you might want to see the issues I encountered when trying to write to two different nodes using Firebase Transactions using the IOS SDK, and then I decided to use the REST API https://stackoverflow.com/questions/45508007
Reply all
Reply to author
Forward
0 new messages