WebAPI/SimplePush/Protocol: Difference between revisions

no edit summary
(added section on ping.)
No edit summary
Line 54: Line 54:


The protocol has some request-response driven actions, where the UserAgent MUST make requests, and the PushServer MAY respond. One message, <tt>notification</tt>, MAY be sent at any time by the PushServer.
The protocol has some request-response driven actions, where the UserAgent MUST make requests, and the PushServer MAY respond. One message, <tt>notification</tt>, MAY be sent at any time by the PushServer.
=== Considerations ===
Since SimplePush is not a data carrying system, there are a few things developers should keep in mind.
1. '''Do not send a SimplePush update message for every bit of exchanged data.'''
This service is a way for you to wake your remote app and have it reconnect back to you. If it's already connected, sending a SimplePush service is wasteful. (It's a bit like sending a fax to make sure the person on the phone got your email.)
2. '''While it's possible to have more than one Channel per App, it helps to be frugal about them.'''
Remember, that each Channel has an associated action, and that they're not really "free", and they can be lossy. A single channel that allows the system to start your app, or a separate channel that advises that a screen widget needs to be updated are all fine uses. Having one channel per bullet path for a FPS game is not, since this will pretty much guarantee data will be lost.
3. '''Don't flood the channel.'''
Nobody likes having something constantly remind you to do something, particularly after you've already done it. In the same way, be conscious that channel updates invoke actions on your user's devices, and may lead to users removing your app. Once your app connects, you'll have a far more efficient and faster pipe than SimplePush.
4. '''Pay attention to endpoint reassignments.'''
When a given user's endpoint changes, the previous endpoint is no longer valid. Updates sent to that endpoint will no longer have any effect and are a waste of your bandwidth. If you send a great many updates to endpoints that are invalid, the server may have a very difficult time determining that you're not being hostile.


=== ChannelID, UAIDs and Endpoints ===
=== ChannelID, UAIDs and Endpoints ===
Confirmed users
1,018

edits