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

How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

Embed Size (px)

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.

Citation preview

Page 1: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

© 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

Page 2: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

Agenda

Worklight Introduction

Business case for Push Notifications

Push Notifications Services

Cross-platform Challenges

Worklight Unified Push Notifications Framework

Q & A

2

Page 3: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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.

Page 4: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 5: How to Enable Unified Push Notifications in Native and HTML5 Hybrid 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)

5

Page 6: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

Key Elements of Push Notifications

Trigger • Behavior-based

• Pre-defined

• Rule-driven

6

Page 7: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 8: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 9: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 10: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 11: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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.

Page 12: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

Availability of Mobile Push Notifications Services

Apple iOS 3

Google Android 2.2

RIM BlackBerry 5

Microsoft Windows Phone 7

12

Page 13: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

Subscribing to Notifications

13

Page 14: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

User Experience – iOS

14

Page 15: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 16: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

User Experience – Android

16

Page 17: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 18: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 19: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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)

Page 20: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile 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

Page 21: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 22: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 23: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

23

Worklight Architecture

Page 24: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 25: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 26: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 27: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 29: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

Demo Scenario

29

login

subscribe

Send notification Receive notification C2DM

A

B

C D

Page 30: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

Demo: (A) Login

30

Page 31: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

Demo: (B) Subscribe

31

Page 32: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

Demo: (C) Send

32

Page 33: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

Demo: (D) Receive

33

Page 34: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 35: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 36: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 37: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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

Page 38: How to Enable Unified Push Notifications in Native and HTML5 Hybrid Mobile Apps

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