This presentation introduces the concept of using other means for delivering push notifications than just APNS server. It solves the reliability problem by using a WebSocket and local push notifications scheduling.
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
In the hunt of 100% delivery rate with mobile push notifications
1. IN THE HUNT OF 100%
DELIVERY RATE WITH MOBILE
PUSH NOTIFICATIONS.
JAN HALOŽAN
2. PUSH NOTIFICATIONS
• Probably familiar
• A way to send information to users
• Even when the app is not in use
• A crucial feature in some apps
• The very meaning of real-time
4. BECAUSE YOU CAN
• Push notifications drive adoption
• Make users stick
• Can provide data at critical times
• Save time from opening the app
• Remind us
• …
6. OUR GOAL
• Get the notification across (you don’t say)
• Get feedback from the app
• When it received a push
• Which push it received
7. PLATFORMS
Android
• GCM
• 4kB
• No confirmation*
• Cache 1 per key
• Solvable with a
BG service
iOS
• APNS
• 255B ! 2kB
• No confirmation
• Cache 1
• Tricky
WinPhone
• MPNS
• 3kB
• No confirmation*
• Cache up to 5*
• Solvable with a
BG agent
8. APNS
• Apple Push Notification Service
• QOS (kind of)
• If the device is offline stores one notification for a limited
period of time
• Only one recent notification for a particular app is stored.
• If the device remains offline for a long time, any
notifications are discarded.
12. HUNT?
• What can we do to make sure the notification got through
• A good place to start is the documentation
• 2 types of notifications
• Remote
• Dispatched from APNS
• Require an available device
• Local
• Scheduled on the device itself
• Work just about anywhere
13. LOCAL
NOTIFICATIONS
• We can’t locally know what happens somewhere remote
• Provider does
• More documentation
• Each notification has a set of predefined fields
• alert
• badge
• sound
• content-available
14. CONTENT-AVAILABLE
• Specifying content-available makes the notification silent
• No alerts, badges, sounds whatsoever
• When a silent notification arrives iOS wakes up the app*
• A chance to check if anything interesting happened
• We must specify some additional settings in our app
15. SOLUTION
• Remove APNS as much as possible
• Silent notifications
• Sync
• Local scheduling
• Feedback
17. SYNC
• Use the same sync procedure when in the app
• Full duplex
• Removes overhead (unlike polling)
• Usable for more than just notifications
• Real time data transfer
• WebSocket
• Solution for Android & WinPhone via a BG service
18. WEBSOCKET
• Full duplex via a TCP socket
• Compatible with existing HTTP APIs
• Client issues an upgrade request
• Independent TCP-based protocol
• Via port 80
• No firewall problems
• Secure mode (wss)
19. HOW TO 101
• A simple custom protocol
+
• WebSocket for server side push
+
• When the connection is active push as much pre-known
pushes as possible
+
• App schedules pushes locally & provides server feedback
=
Profit
20. PROS WITH LOCAL
NOTIFICATIONS
• Much better control over local notifications
• Ability to cancel one by one
• In contrast APNS can only cancel them at once
• 100% delivery rate
• Even if the device is unreachable
21. PROTOCOL
Note: this is a very simple DEMO protocol
PSH METHOD type
Fire-Time: TIMESTAMP
Title: STRING
Body: STRING
PSH – protocol name (to distinguish it from others)
METHOD – SCHEDL / CANCEL
Type – notif
Fire-Time: %Y-%m-%d %H:%M:%S
22. TIME TO GET OUR
HANDS DIRTY
<insert demo here>
23. CONCLUSION
• APNS is a very powerful tool
• If we know how to leverage it properly
• Still not a clean 100%
• Better than APNS alone
25. IMPROVEMENTS
• Include badge numbers
• Difference between actual badge number (set by iOS) and
out locally cached value
• More background modes
• VoIP apps
• Silent notifications also usable for by data sync