You are on page 1of 39

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

2011 Worklight, Inc. All rights reserved. The information contained herein is the proprietary and confidential information of Worklight.

Agenda
Worklight Introduction Business case for Push Notifications Push Notifications Services Cross-platform Challenges Worklight Unified Push Notifications Framework Q&A

Worklight Introduction
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
Provide the best platform in the market for enterprises to develop, run and manage smartphone and tablet apps
Open platform, built around HTML5 & supporting hybrid apps Focus on new devices and OSs 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

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)

Key Elements of Push Notifications


Trigger
Behavior-based Pre-defined Rule-driven

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
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

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


Business-to-Consumer Business-to-Business Business-to-Employee
Engagement Content, social, product fulfillment Content, social, product fulfillment Delivery, billing Special offers, inventory alerts Delivery, billing ERP, BPM Content, social

Self-service / Productivity
Revenue

Financial, scheduling, customer service


Product price / availability alerts, special offers

CRM, ERP, BPM

Cost savings

Many examples across all verticals financial services, insurance, healthcare, retail, travel, manufacturing, Pharma, technology, government, and more.
11

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


Destination app is in the foreground

Notification arrives to device

Another app is in the foreground

Dialog, sound, badge, notification center (user configuration)

User clicks item in the Notification Center

iOS invokes app's callback

Device is locked or on home screen

Dialog, sound, badge, notification center (user configuration)

User clicks View in the notification dialog box

15

User Experience Android

16

Receiving a Notification on Android


Destination app is in the foreground

Notification arrives to device

Otherwise

Android updates notification center

User clicks item in Notification Center

Android invokes app's callback

17

Benefits of Push Notifications


User Control
Users need to subscribe to receive notifications

Ease of Use

Users receive notifications also when app is not active

Efficiency
18

No need to issue constant queries from app Reduces development overhead Saves battery usage and communication fees

Notification Payload and Options


Purpose: Signal to user or app that something new happened

Basic scenario Payload size Payload structure Badge

User to take an action 256 bytes Custom key-value pairs Appears on app icon

App to take an action 1024 bytes Custom key-value pairs Appears on notification icon

Sound
Dialog box

Settable by Server
Settable by Server

Not by default
(Programmable by app)

Not by default
(Programmable by app or by thirdparty apps)

19

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 Security Content Trust Connectivity problems Streaming TCP/IP socket SSL Binary Certificate provisioned by Apple HTTP POST SSL JSON Gmail account required per server Server must implement exponential back off upon receiving HTTP 503 Response to POST request contains indicates whether device is obsolete or not

"Device not found" errors

Server must query asynchronous feedback service and remove obsolete device tokens

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

Worklight Architecture

23

Unified Push Notifications Framework by Worklight


iOS Push API

iOS Dispatcher Back-end Back-end System System

Apple Push Servers (APN)

Worklight Client-side Push Services

Polling Adapters

Notification State Database Unified Push API

Android Dispatcher

Android Push API

Google Push Servers (C2DM)


RIM Push Servers

Worklight Client-side Push Services

BlackBerry Dispatcher
Windows Phone Dispatcher SMS Dispatcher

BlackBerry Push API

Worklight Client-side Push Services

Back-end Back-end System System

Messagebased Adapters

UserDevice Database

Windows Push API

Microsoft Push Servers

Worklight Client-side Push Services

Broker API

Administrative Console

SMS/MMS Brokers

24

Unified Push Notifications Framework by Worklight


iOS Push API

iOS Dispatcher Back-end Back-end System System

Apple Push Servers (APN)

Worklight Client-side Push Services

Polling Adapters

Notification State Database Unified Push API

Android Dispatcher

Android Push API

Google Push Servers (C2DM)


RIM Push Servers

Worklight Client-side Push Services

BlackBerry Dispatcher
Windows Phone Dispatcher SMS Dispatcher

BlackBerry Push API

Worklight Client-side Push Services

Back-end Back-end System System

Messagebased Adapters

UserDevice Database

Windows Push API

Microsoft Push Servers

Worklight Client-side Push Services

Broker API

Administrative Console

SMS/MMS Brokers

25

Unified Push Notifications Framework by Worklight


iOS Push API

iOS Dispatcher Back-end Back-end System System

Apple Push Servers (APN)

Worklight Client-side Push Services

Polling Adapters

Notification State Database Unified Push API

Android Dispatcher

Android Push API

Google Push Servers (C2DM)


RIM Push Servers

Worklight Client-side Push Services

BlackBerry Dispatcher
Windows Phone Dispatcher SMS Dispatcher

BlackBerry Push API

Worklight Client-side Push Services

Back-end Back-end System System

Messagebased Adapters

UserDevice Database

Windows Push API

Microsoft Push Servers

Worklight Client-side Push Services

Broker API

Administrative Console

SMS/MMS Brokers

26

Unified Push Notifications Framework by Worklight


iOS Push API

iOS Dispatcher Back-end Back-end System System

Apple Push Servers (APN)

Worklight Client-side Push Services

Polling Adapters

Notification State Database Unified Push API

Android Dispatcher

Android Push API

Google Push Servers (C2DM)


RIM Push Servers

Worklight Client-side Push Services

BlackBerry Dispatcher
Windows Phone Dispatcher SMS Dispatcher

BlackBerry Push API

Worklight Client-side Push Services

Back-end Back-end System System

Messagebased Adapters

UserDevice Database

Windows Push API

Microsoft Push Servers

Worklight Client-side Push Services

Broker API

Administrative Console

SMS/MMS Brokers

27

Push Notifications Demo


Source code and running instructions available on http://worklight.com/download/get-started/4.2/

28

Demo Scenario
A
login

B
subscribe

C
Send notification

D C2DM
Receive notification

29

Demo: (A) Login

30

Demo: (B) Subscribe

31

Demo: (C) Send

32

Demo: (D) Receive

33

Subscribing to Notifications
1. Connect to Worklight Server 2. Get Subscription Details 3. Per Event Source: 4. Manage Subscriptions 5. Handle Subscription Changes at Server

Already subscribed?
Login Is ready to subscribe Not yet subscribed?

Register callback for notifications Allow unsubscribing Allow subscribing Custom subscription removal logic Custom subscription logic

Invocation of Worklight API

Custom implementation

34

Pushing Notifications
Actively poll back-end or wait for back-end events Use any adapter: REST, SOAP, JDBC, JMS Single messages or batch

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

Invocation of Worklight API

Custom implementation

35

Flexible Push Notification Framework


One application multiple devices Custom subscription management

Many-to-many relationship between event sources and apps

Multiple event sources from same back-end

Multiple users logging into the same app

36

Scalable Push Framework


Nodes communicate with APNS and C2DM using same credentials for each service

APNS Event Source

All or some Worklight nodes can process data from the same event source Integration available for any back-end communication protocol
37

C2DM

Segregation of Subscription and Push


Network zone open only for incoming requests

APNS
Subscription database

Network zone open only for outgoing requests Event Source

C2DM

38

For More Information


Resource Location

30-day Software Trial Online Training Documentation Whitepapers


Webinars Additional Info

www.worklight.com/download www.worklight.com/download/get-started www.worklight.com/download/documentation www.worklight.com/resources/product-resources


www.worklight.com/resources/webinars-and-tools info@worklight.com

39