本文介绍了用于推送通知的 Nodejs 和 socket.io的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前希望向我正在开发的 iphone 和 android 应用程序提供推送通知.我查看了推送通知服务,它们非常昂贵,所以我希望使用 socket.io 运行我自己的服务.

I'm currently looking to offer push notifications to an iphone and android app I'm working on. I took a look at the push notification services and they are very expensive so, I'm looking to run my own using socket.io.

我想我的问题是,推送通知对服务器的要求有多高?我是否需要大量带宽或某些特定的服务器设置?

我之前没有使用过推送通知来估计我需要的数量.

I haven't used push notifications before to estimate the amount I would need sadly.

目前我正在将 Nodejitsu 用于我的 nodejs 应用程序,并计划让它也托管推送服务器,以实现其价值.

Currently I'm using Nodejitsu for my nodejs app and plan to have it host the push server too for what its worth.

任何为我指明正确方向的帮助都会有很大帮助.

Any help to point me in the right direction will help a lot.

推荐答案

所需的带宽取决于您计划每天推送的通知数量.每个通知都相对较小(对于 Apple 推送通知 - 最多 256 字节的有效载荷 + 一些开销

The required bandwidth depends on the number of notifications you are planning to push every day. Each notification is relatively small (for Apple Push Notifications - up to 256 bytes payload + some overhead < 400 bytes per message; for Google Cloud Messaging - up to 4K bytes payload + some overhead < 5K bytes per message). You can do the math.

此外,对于 Apple 推送通知,您的服务器必须允许连接到传出端口 2195 &2196.我不熟悉Nodejitsu,所以不能给你更具体的信息.

In addition, for Apple Push Notifications your server must allow connection to outgoing ports 2195 & 2196. I'm not familiar with Nodejitsu, so I can't give you more specific information.

这篇关于用于推送通知的 Nodejs 和 socket.io的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 00:53