4 ms·
> Microsoft's Push Notification Service (WNS) is a HTTP-based, which is awesome. Apple introduce a TCP-based approach to push notifications that basically requi
by nupark2 15y ago
> Microsoft's Push Notification Service (WNS) is a HTTP-based, which is awesome. Apple introduce a TCP-based approach to push notifications that basically requires you to write a dedicated sever (again, somehow, Apple didn't specify how to do) to send your push notifications through their APNS. No one rolls their own APNS server because it's too hard and there's Urban Airship.
This is ostensibly a professional engineer, and this position drives me bonkers ("not HTTP, too hard")!
Apple provided protocol documentation and a very, very simple TCP+SSL protocol. Rolling your own client should be a matter of a day or two of work, at the absolute maximum.
Apple even provides sample code: http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW1 http://developer.apple.com/library/mac/#documentation/Networ...
The fact that people are frightened of TCP and a simple binary protocol is a mind-boggling indictment of the ineptitude and inexperience of the engineers that have been placed in a position of responsibility.
I dealt with a server team recently that refused to consider a push-based feature because it would "cost too much to send that many pushes through Urban Airship". Implementing their own local client for the protocol never occurred to them, and our doing so for them dismissed out of hand ("too complicated").
- untog 15y agoBut what is the actual advantage? Its all very well saying that it's easy to implement Apple's solution, but HTTP is simpler. What makes it worth having to spend a day or two on a custom solution?
- nupark2 15y ago> But what is the actual advantage? Efficient high throughput performance. That's why Apple went with the protocol they did in the first place. > What makes it worth having to spend a day or two on a custom solution? It's not "custom", it's just a TCP connection. I quoted a day or two as a maximum estimate, assuming someone totally unfamiliar with the space, and possible integration issues with their existing infrastructure. I'd be surprised if Urban Airship was fully integrated any faster, since most of the heavy lifting will be in managing state and creating an internal push API, not in speaking TCP+SSL to Apple. [edit] Here's an implementation in about 20 lines of Python: http://blog.nuclearbunny.org/2009/05/11/connecting-to-apple-push-notification-services-using-python-twisted/ http://blog.nuclearbunny.org/2009/05/11/connecting-to-apple-...
- AshFurrow 15y agoI'm aware of Apple's sample code, I attended the WWDC talk on integrating Push Notifications. I'm just not aware of many Ruby developers interested in taking Apple's C example and implementing it in Ruby. HTTP POST is simpler for the developer. TCP is better for Apple. Apple has the resources to scale, so "TCP is faster" isn't really an excuse, in my ostensibly professional opinion.
- deleted 15y ago[deleted]
- Rusky 15y agoApple has the resources to scale, so "TCP is faster" isn't really an excuse Really? HTTP is just sending lines of text over TCP- what's so hard about a binary format instead? In many ways it's easier. You shouldn't need an excuse to remove unnecessary layers of translation.
- AshFurrow 15y agoFor a hobby developer or small business where time is precious, using built-in HTTP libraries is far easier and faster than implementing this: http://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Art/aps_provider_binary.jpg http://developer.apple.com/library/mac/documentation/Network... Sorry, but you're not going to convince me that rolling your own implementation of Apple's APNS is better than an HTTP-based APNS would have been.
- nupark2 15y ago> For a hobby developer or small business where time is precious, using built-in HTTP libraries is far easier and faster ... Sorry, but you're not going to convince me that rolling your own implementation of Apple's APNS is better than an HTTP-based APNS would have been. Something is rotten in the state of Denmark; if this can be done in 20 lines of Python (see comment above), then why do so many ostensibly capable engineers find it so difficult?