FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM...

17
FCM Workflow using GCM

Transcript of FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM...

Page 1: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

FCM Workflow using GCM

Page 2: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

2

Agenda

• Polling Mechanism • What is GCM• Need / advantages of GCM• GCM Architecture• Working of GCM• GCM – Send to Sync [ HTTP ] and Send Data [ XMPP ]• Google Cloud Messaging – APIs• Implementation

Page 3: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

3

Existing FCM uses Polling

Polling is simple to implement,But Polling consumes lot of battery , resource.Extra Network Usages.

Any new updates ?

No

Any new updates ?

No

Any new updates ?

YES

Page 4: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

4

GCM

Page 5: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

5

What is GCM

• GCM stands for Google Cloud Messaging.

• It is a free service that allows you to send data from your servers to your users and vice versa.

• Handles queuing of messages and delivery to the target application.

Page 6: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

6

Need / advantages of GCM

• Application does not need to be running in the background for receiving data messages. The system will wake up the Android application via Intent broadcast when the message arrives.

• Lower cost and better tracking than SMS

• Scalability & extensibility

• GCM is completely free no matter how big your messaging requirements

Page 7: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

7

GCM Architecture

Page 8: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

8

Working of GCM

Mobile App

GCM

1.Request for Registration

2.Reply with Registration Id

5. Send Message

3.Send Registration Id 4. Send message {RegId, msg }

Page 9: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

9

GCM – Send to Sync [HTTP]

Mobile App

GCM2. Send Notification message

3. Download data 1. Send Notification message

Page 10: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

10

GCM – Send Data [ XMPP ]

Mobile App

GCM

Send message

Send message

Persistent XMPP connection

Page 11: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

11

Google Cloud Messaging – APIs

Time To Live and Delay While Idle

Multiple Senders

Message Multicasting

Page 12: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

12

Implementation

• Creating a Google API project

• Enabling the GCM Service

GCM Server

Page 13: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

13

Implementation Mobile App

Copy the required

libsMake

changes to the

manifest

Add a broadcas

t receiver

Add an Intent

service

Wire it up in your

activity

Page 14: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

14

Implementation

• Expose Service to receive and store user information and GCM registration Id.

• Send message to GCM service.

Application Server

Page 15: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

15

Minimum requirements ( device side )

• Android 2.2 +

• Google Play Store application should be installed

• Internet connection

• Google account ( device version < 4.0.4 )

• For Developer Emulator with Google APIs

Page 17: FCM Workflow using GCM. Agenda Polling Mechanism What is GCM Need / advantages of GCM GCM Architecture Working of GCM GCM – Send to Sync [ HTTP ] and.

Thank you

Any questions?