how to enable unified push notifications in native and html5 hybrid mobile apps
DESCRIPTION
A detailed overview of push mechanisms across all major mobile operating systems and the Worklight Unified Push Notifications Framework for iOS and Android smartphones and tablets.TRANSCRIPT
© 2011 Worklight, Inc. All rights reserved. The information contained herein is the proprietary and confidential information of Worklight.
How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps
Amit Ben-Sheffer, Director of Product Management
Yonni Harif, Head of Marketing
Agenda
Worklight Introduction
Business case for Push Notifications
Push Notifications Services
Cross-platform Challenges
Worklight Unified Push Notifications Framework
Q & A
2
Worklight Introduction
3
Worklight is an open and advanced mobile app platform for developing, running and managing HTML5, hybrid and native applications for smartphones and tablets.
Worklight Vision
Open platform, built around HTML5 & supporting hybrid apps
Focus on new devices and OS’s and their unique capabilities
Cater to high-end enterprise needs regarding app capabilities, delivery, integration, security, scale and management
Handle the entire lifecycle of mobile apps
4
Provide the best platform in the market for enterprises to develop, run and manage smartphone and tablet apps
Push Notifications Defined
“Notifications are "pushed" by the event producer component (the event "source"), they are not "pulled" by the event consumer component. The producer decides when to send the notification, because it knows about the event before the consumer does.”
(Gartner: Hype Cycle for Application Architecture, 2011)
5
Key Elements of Push Notifications
Trigger • Behavior-based
• Pre-defined
• Rule-driven
6
Key Elements of Push Notifications
Trigger • Behavior-based
• Pre-defined
• Rule-driven
Content type • Universal versus Personalized
• Open versus Protected
• Lean versus Detailed
• Time-sensitive versus Any-time
7
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper dictum orci, in iaculis sem faucibus eget. Vivamus non diam id dui volutpat semper.
Lorem ipsum
Key Elements of Push Notifications
Trigger • Behavior-based
• Pre-defined
• Rule-driven
Content type • Universal versus Personalized
• Open versus Protected
• Lean versus Detailed
• Time-sensitive versus Any-time
User behavior • Read only
• Read/Write
• Act-Outside-the-App
8
Key Elements of Push Notifications
Trigger • Behavior-based • Pre-defined • Rule-driven
Content type • Universal versus Personalized • Open versus Protected • Lean versus Detailed • Time-sensitive versus Any-time
User behavior • Read only • Read/Write • Act-Outside-the-App
Nice to have • Analytics, feedback, etc
9
Business Case for Push Notifications
User engagement is critical to business success and mobile plays a big role in this process
Push notifications are an expression of app-based user engagement
Push notifications have a measurable impact on mobile app success and user behavior
Inherent IT challenges in enabling mobile Push across operating systems and devices can and should be overcome
10
Use Cases for Push Notifications
11
Business-to-Consumer Business-to-Business Business-to-Employee
Engagement Content, social, product
fulfillment Content, social, product
fulfillment Content, social
Self-service / Productivity
Financial, scheduling, customer service
Delivery, billing CRM, ERP, BPM
Revenue Product price / availability
alerts, special offers Special offers, inventory
alerts
Cost savings Delivery, billing ERP, BPM
Many examples across all verticals – financial services, insurance, healthcare, retail, travel, manufacturing, Pharma, technology, government, and more.
Availability of Mobile Push Notifications Services
Apple iOS 3
Google Android 2.2
RIM BlackBerry 5
Microsoft Windows Phone 7
12
Subscribing to Notifications
13
User Experience – iOS
14
Receiving a Notification on iOS
15
Device is locked or on home screen
Another app is in the foreground
User clicks View in the notification dialog box
User clicks item in the Notification Center Notification
arrives to device
Dialog, sound, badge, notification
center (user configuration)
iOS invokes app's callback
Dialog, sound, badge, notification
center (user configuration)
Destination app is in the foreground
User Experience – Android
16
Receiving a Notification on Android
17
User clicks item in Notification Center Notification
arrives to device
Android updates notification
center
Android invokes app's callback
Otherwise
Destination app is in the foreground
Benefits of Push Notifications
• Users need to subscribe to receive notifications User Control
• Users receive notifications also when app is not active Ease of Use
• No need to issue constant queries from app
• Reduces development overhead
• Saves battery usage and communication fees Efficiency
18
Notification Payload and Options
Purpose: Signal to user or app that something new happened
19
Basic scenario User to take an action App to take an action
Payload size 256 bytes 1024 bytes
Payload structure Custom key-value pairs Custom key-value pairs
Badge Appears on app icon Appears on notification icon
Sound Settable by Server Not by default (Programmable by app)
Dialog box Settable by Server Not by default (Programmable by app or by third-party apps)
Delivery of Notifications
Only unicast; No batch delivery, multicast or broadcast
Quality of Service • Queue size: One message waiting per app per device
• No guarantied delivery
• No delivery notification
• Delivery expiry: only for iOS
Quota • iOS: Unspecified
• Android: 200K (can ask for more)
20
Communication Protocol
Connection Streaming TCP/IP socket HTTP POST
Security SSL SSL
Content Binary JSON
Trust Certificate provisioned by Apple
Gmail account required per server
Connectivity problems - Server must implement exponential back off upon receiving HTTP 503
"Device not found" errors Server must query asynchronous feedback service and remove obsolete device tokens
Response to POST request contains indicates whether device is obsolete or not
21
Limitations and How to Overcome Them
Limitations • Short message size
• No guarantee that delivery chain is secure
• Delivery
• Generally not guaranteed
• Users can always sign out inadvertently
• Users can disable push to save battery
Overcoming Limitations • Notify that something changed, have app securely pull information
• Alternatives: SMS + e-mail, phone call
22
23
Worklight Architecture
Back-end System Back-end System
Unified Push Notifications Framework by Worklight
Back-end System Back-end System
Polling Adapters
Message-based
Adapters
Unified Push API
Notification State
Database
User-Device
Database
iOS Dispatcher
Android Dispatcher
BlackBerry Dispatcher
Windows Phone
Dispatcher
SMS Dispatcher
Apple Push Servers (APN)
Google Push
Servers (C2DM)
RIM Push Servers
Microsoft Push
Servers
SMS/MMS Brokers Administrative Console
Worklight Client-side
Push Services
Worklight Client-side
Push Services
Worklight Client-side
Push Services
Worklight Client-side
Push Services
iOS Push API
Android Push API
BlackBerry Push API
Windows Push API
Broker API
24
Back-end System Back-end System
Unified Push Notifications Framework by Worklight
Back-end System Back-end System
Polling Adapters
Message-based
Adapters
Unified Push API
Notification State
Database
User-Device
Database
iOS Dispatcher
Android Dispatcher
BlackBerry Dispatcher
Windows Phone
Dispatcher
SMS Dispatcher
Apple Push Servers (APN)
Google Push
Servers (C2DM)
RIM Push Servers
Microsoft Push
Servers
SMS/MMS Brokers Administrative Console
Worklight Client-side
Push Services
Worklight Client-side
Push Services
Worklight Client-side
Push Services
Worklight Client-side
Push Services
iOS Push API
Android Push API
BlackBerry Push API
Windows Push API
Broker API
25
Back-end System Back-end System
Unified Push Notifications Framework by Worklight
Back-end System Back-end System
Polling Adapters
Message-based
Adapters
Unified Push API
Notification State
Database
User-Device
Database
iOS Dispatcher
Android Dispatcher
BlackBerry Dispatcher
Windows Phone
Dispatcher
SMS Dispatcher
Apple Push Servers (APN)
Google Push
Servers (C2DM)
RIM Push Servers
Microsoft Push
Servers
SMS/MMS Brokers Administrative Console
Worklight Client-side
Push Services
Worklight Client-side
Push Services
Worklight Client-side
Push Services
Worklight Client-side
Push Services
iOS Push API
Android Push API
BlackBerry Push API
Windows Push API
Broker API
26
Back-end System Back-end System
Unified Push Notifications Framework by Worklight
Back-end System Back-end System
Polling Adapters
Message-based
Adapters
Unified Push API
Notification State
Database
User-Device
Database
iOS Dispatcher
Android Dispatcher
BlackBerry Dispatcher
Windows Phone
Dispatcher
SMS Dispatcher
Apple Push Servers (APN)
Google Push
Servers (C2DM)
RIM Push Servers
Microsoft Push
Servers
SMS/MMS Brokers Administrative Console
Worklight Client-side
Push Services
Worklight Client-side
Push Services
Worklight Client-side
Push Services
Worklight Client-side
Push Services
iOS Push API
Android Push API
BlackBerry Push API
Windows Push API
Broker API
27
Push Notifications Demo
Source code and running instructions available on http://worklight.com/download/get-started/4.2/
28
Demo Scenario
29
login
subscribe
Send notification Receive notification C2DM
A
B
C D
Demo: (A) Login
30
Demo: (B) Subscribe
31
Demo: (C) Send
32
Demo: (D) Receive
33
Subscribing to Notifications
5. Handle Subscription Changes at
Server
4. Manage Subscriptions
3. Per Event Source:
2. Get Subscription
Details
1. Connect to Worklight
Server
Login Is ready to subscribe
Already subscribed?
Register callback for notifications
Allow unsubscribing
Custom subscription removal logic
Not yet subscribed?
Allow subscribing
Custom subscription
logic
34
Custom implementation
Invocation of Worklight API
Pushing Notifications
Get message from data
source
Format notification; set badge, sound, and dialog box
Identify the destination
user
Get user's subscriptions
(one per device) for
the data source
Send notification
per subscribed
device
35
• Actively poll back-end or wait for back-end events
• Use any adapter: REST, SOAP, JDBC, JMS
• Single messages or batch
Custom implementation
Invocation of Worklight API
Flexible Push Notification Framework
36
Multiple users logging into the same app
Multiple event sources from same back-end
Many-to-many relationship between event sources and apps
One application multiple devices Custom subscription management
Scalable Push Framework
37
Event Source
APNS
C2DM
…
• All or some Worklight nodes can process data from the same event source
• Integration available for any back-end communication protocol
• Nodes communicate with APNS and C2DM using same credentials for each service
Network zone open only for outgoing requests
Network zone open only for incoming requests
Segregation of Subscription and Push
38
Event Source
APNS
C2DM
Subscription database
For More Information
39
Resource Location
30-day Software Trial www.worklight.com/download
Online Training www.worklight.com/download/get-started
Documentation www.worklight.com/download/documentation
Whitepapers www.worklight.com/resources/product-resources
Webinars www.worklight.com/resources/webinars-and-tools
Additional Info [email protected]