

PushServer – Node.js server for sending iOS push notifications - jazzychad
https://github.com/jazzychad/PushServer

======
y0ghur7_xxx
I used this one a few months ago: [https://github.com/Smile-SA/node-
pushserver](https://github.com/Smile-SA/node-pushserver)

Works for android as well, and has a nice web interface too.

~~~
jazzychad
interesting, i hadn't seen that! it does say it's not meant to be a front-
facing server since it has no authentication, which is a slight downside (one
of the reasons I added github auth to mine was to allow logging in from
anywhere)

~~~
y0ghur7_xxx
Just put apache or nginx in front of it and let that handle auth.

------
moondowner
There's a pretty nice Java variant of this from JBoss:
[http://aerogear.org/docs/specs/aerogear-server-
push/#overvie...](http://aerogear.org/docs/specs/aerogear-server-
push/#overview)

Works with Apple’s APNs, Google Cloud Messaging and Mozilla’s Simple Push.

------
latchkey
I built something similar for a client once.

Starting up the server without ensuring a connection to mongo seems dangerous,
no?
[https://github.com/jazzychad/PushServer/blob/master/app.js#L...](https://github.com/jazzychad/PushServer/blob/master/app.js#L12)

Basically, you want to listen for the 'open' event and then start the express
server... db.once('open', function() { start express here })

A very important future feature would be to handle apns feedback service too
(I see that in your TODO). I hear that if you don't enable this, apple will
throttle your messages.

~~~
jazzychad
yes, feedback service integration is next on the priority list. i think it
should take about 30 minutes or so. so far this whole project is only a few
hours of work. i don't open-source much of my code, but i thought this might
be a good candidate.

------
joeblau
Does anyone know if a golang variant of this?

~~~
pdappollonio
Uniqush (sorry for not posting a link, but I'm from mobile now)

~~~
joeblau
Perfect. I found it [http://uniqush.org/](http://uniqush.org/). Thanks a lot.

------
gdeglin
Nice to see more open source push notification tools, and the quality is
generally getting better.

The main drawbacks to PushServer seems to be that it's not cross platform, and
it doesn't interact with Apple's feedback service. Apple has an ominous
warning for people who decide to do this: "APNs monitors providers for their
diligence in checking the feedback service and refraining from sending push
notifications to nonexistent applications on devices." [1] Though it's unclear
what the penalty really is, and this is listed as a TODO item by PushServer
[2]

My company decided to build a push notification system in house. We needed it
to be cross platform, able to handle very large volumes, and fully follow all
of Apple and Google's guidelines. We recently released it as a service for
other game developers: [https://gamethrive.com](https://gamethrive.com)

Having built something like this myself and wrestling through the all the edge
cases, I've come to the conclusion that unless you have a good reason for
doing so, you should outsource sending of push notifications to a 3rd party
service. Parse, Urbanairship, and GameThrive (our service) do a good job and
are way less expensive than maintaining it yourself, especially if you plan to
deliver a high volume or have multiple platforms to deal with.

[1]
[https://developer.apple.com/library/ios/documentation/Networ...](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW3)

[2]
[https://github.com/jazzychad/PushServer/blob/master/TODO.md](https://github.com/jazzychad/PushServer/blob/master/TODO.md)

~~~
jazzychad
...thx for the FUD on my three hour project I decided to give to the world.
This is generally why I don't open-source stuff.

Feedback support is coming. Also as noted below, I am familiar with iOS push
having built a previous YC startup around it.

Some class of people will want to do it themselves. I am one of those,
presumably the audience on HN is full of those ppl, it's why I posted it here.
Doing is learning.

------
farhanpatel
This seems like a more full fledged APNS server with a web frontend.

If you are looking for more transactional approach to integrate into an
existing node app. I've been using node-apn in production for almost a year
now. works well.

[https://github.com/argon/node-apn](https://github.com/argon/node-apn)

~~~
jazzychad
yes, PushServer uses the node-apn module for delivery, I just built the device
token database, notion of channels, and the web frontend around it.

------
badhairday
This is awesome. Are there any projects like this written in Ruby that I can
easily integrate into a Rails app?

~~~
_neil
You may want to look at houston [0] and/or helios [1].

[0] [https://github.com/nomad/houston](https://github.com/nomad/houston)

[1] [http://helios.io/](http://helios.io/)

~~~
gdeglin
For Ruby I definitely recommend RPush:
[https://github.com/rpush/rpush](https://github.com/rpush/rpush). Helios
hasn't been updated in a very long time and has a massive list of unresolved
issues.

~~~
_neil
Thanks. I hadn't seen rpush and it looks great.

------
encoderer
This looks promising. Though I have to add, sending push notifications is on
the list of things I _definitely_ outsource, along with email delivery,
analytics, payment processing, etc.

~~~
eddieroger
Why? The message format is relatively simple to compose, and every language
has at least one library to make the process easier. The connections to
Apple/Google are free, and you've probably already got a database of some
sort, so why not just do it yourself?

~~~
encoderer
Because it's a headache and hassle that's not worth it. Using a saas service
is not a large expense and frees up time and mindshare to focus on things I
can add value to.

Best case scenario you have to:

1\. Worry about Apple AND Google push notification infrastructure 2\. Manage
device tokens 3\. Forever add one more cron to your life to manage device
token invalidation requests for Apple (Is there something similar for Google?
I dunno) 4\. Gotta keep your certs/keys updated

Yes, you can work around all that stuff. Of course you can, people _are_ doing
this after all. But an even better option to me is to spend a small sum and
let somebody else worry about these boilerplate systems.

------
tomblomfield
This seems to open-source a large part of urbanairship's core value-add?

Anyone with experience of either care to comment?

~~~
jcampbell1
I don't understand either. It seems the use case is limited to pushing a
notification to all devices. I know plenty of apps do that, but it is
generally just spammy.

Any app that needs to send custom push notification to individual users needs
to have connected the user_id to the device_id. Once you go the Urban Airship
route, there is basically no way to do anything useful with push
notifications.

Parse seems to be the only 3rd party service that can do something useful, but
you would need to use their user/authentication system.

~~~
askar
Parse has become so unreliable and my users complain a lot about APNS not
going through. It's working for some and not working for many in PROD. Hard to
figure why it's not working as everything else you touch in Parse will ask for
a paid service (straight to Enterprise Plan!). Will have to code something by
myself.

------
fastest963
Does this actually require Heroku?

~~~
jazzychad
no, it doesn't require heroku, it could easily be used in other environment. i
just used heroku initially since it was simple and free to spin up.

------
skalla
Awesome!

