Service connecting to Firebase a bad idea?

后端 未结 2 612
执笔经年
执笔经年 2021-01-17 14:02

I am building an Android app that requires real time updates. My server is Firebase. Firebase is meant to receive its updated data when the user is connected to the server.

2条回答
  •  醉酒成梦
    2021-01-17 14:46

    You probably want to use GCM in these situations.

    Firebase works fine from a background service, but it leaves a socket open, so it's going to use quite a bit of power. This power usage is fine when a user is actively engaged with your app (the screen probably uses a lot more), but when it's running in the background, it's going to be hard on battery life.

    In most cases, when your user isn't actively engaged, they're willing to accept slower response times, and push services like GCM are a better value in watts per user happiness.

    Also, Firebase is working on adding triggers, as demonstrated in this video from Google Cloud Platform Live, that will make it a lot easier to integrate with push services like GCM in the future.

    And I guess you could say James is a Firebase dev. He's one of the co-founders :)

提交回复
热议问题