SlideShare una empresa de Scribd logo
1 de 14
Lavakush Verma
Introduction
Google Cloud Messaging for Android (GCM):
 Its a service that helps developers send data from servers to their
Android applications on Android devices.
 It could be a lightweight message telling application to fetch new data, or
a message with payload data to be consumed instantly.
 GCM handles all aspects of queuing of messages and ensures delivery
to the application on target devices up to a great extent.
 The best part, its totally free irrespective of your needs and has No Quota
system as we had with version of C2DM.
 It’s a replacement to C2DM, which is now deprecated. As no more C2DM
signups are acceptable.

 Provides backward support for devices running on Android 2.2 OS
version. Pre OS-Ver 3.x devices, it requires to setup at least on Google
account. Which is not at all required for devices running Ver-4.0 and
above.

1
GCM Architecture
 Components: physical entities
– Mobile Device (running with 2.2 or above OS Version)
– 3rd Party App Server
– GCM Servers

 Credentials: to ensure approved sender and delivery to correct
place
– SenderID (ProjectID)
– ApplicationID
– RegistrationID
– Google Account: if device running below ICS version.
– Sender Auth Token

2
Enabling GCM: Registration

@Override
protected void onCreate(Bundle saveInstanceState){
if( GCMRegistrar.getRegistrationId(this).equals(“”)){

GCMRegistrar. Register(this, “965748474884”);
}
}
@Override
protected void onRegistered(Context ctx, String regId){

sendToFootballServer(regId);
}

3
How GCM Server works?
(Receiving/Sending)
Content-Type:application/json
Authorization:key=AIzaSyB-1uEai2WiUapxCs2Q0GZYzPu7Udno5aA
{ “registration_ids” : [“APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...”],
“data” : { “Team” : “Portugal”,
“Score” : “3”,
“Player” : “Varela”,
},
}

4
Sending a Message:
 The application server issues a POST request to
https://android.googleapis.com/gcm/send
HttpRequest :Body(JSON)
{
"collapse_key": "score_update",
"time_to_live": 108,
“delay_while_idle": true,
"data": { "score": "4x8", "time": "15:16.2342" },
"registration_ids":["4", "8", "15", "16", "23", "42"]
}

HttpResponse:Body(JSON)
{
"multicast_id": 216,
"success": 3,
"failure": 3,
"canonical_ids": 1,
"results": [ { "message_id": "1:0408" },
{ "error": "Unavailable" },
{ "error": "InvalidRegistration" },
{ "message_id": "1:1516" },
{ "message_id": "1:2342", "registration_id": "32" },
{ "error": "NotRegistered"} ]
}

5
Uniqueness of GCM: Features
 Message Multicasting
– More than 1 devices can receive one message simultaneously

 Multiple Senders with Single RegID
– More than 1 server can send messages to one App

 TTL : Time To Live
– Expiry of sent messages

 Messages with Payload
– To avoid sync with server for certain needs.

 Throttle Queue
– GCM Optimization for battery

 GCM Reliability

6
Message Multicasting
 One Message Request – Many Devices
 Up to 1000 Devices simultaneously

7
Multiple Senders
 One common Registration ID
 Multiple sender can send messages to one Application
 Up to 100 Project IDs (Servers)
@Override
protected void onCreate(Bundle savedInstanceState) {
if (GCMRegistrar.getRegistrationId(this).equals(“”)) {
GCMRegistrar.register(this, “968350041068”, “652183961211”);
}

8
TTL: Time To Live
 Indicates the duration to which GCM can store this message.
 From 0 sec to 4 weeks
 Messages with 0 will not be stored on GCM (Receive – Send –
Delete)
 Default is 4 Weeks
 Best Use case for Advertisements( Like sending deals and offers
during football match)

9
Messages with Payload
 Payload up to 4K per message
 Up to 100 Messages can be stored
 Deletes all and creates a message to trigger sync after that

 Best use for Ims and Online Server Gaming Apps
{
“message_type” : “deleted_messages”,
“total_deleted” : “115”,
},

10
GCM Optimization
 Throttle Queue
– Provide fresh data all the time.
– Optimized for battery life.
– Delay in Delivery

 Reliability

11
GCM Un-Registration

12
Google Cloud Messaging

Más contenido relacionado

La actualidad más candente

Sixth Sense Seminar ppt
Sixth Sense Seminar pptSixth Sense Seminar ppt
Sixth Sense Seminar pptshwetha shwet
 
Sixth sense technology
Sixth sense technology Sixth sense technology
Sixth sense technology Mohamed Sahl
 
Ambient intelligence (AmI)
 Ambient intelligence (AmI)  Ambient intelligence (AmI)
Ambient intelligence (AmI) Maneesh B.S
 
Virtual Surgery
Virtual SurgeryVirtual Surgery
Virtual Surgerybiomedicz
 
Augment your reality with ARCore !
Augment your reality with ARCore !Augment your reality with ARCore !
Augment your reality with ARCore !Wajdi Ben Rabah
 
Virtual Personal Assistant
Virtual Personal AssistantVirtual Personal Assistant
Virtual Personal Assistantsohaildanish
 
Gesture recognition technology ppt
Gesture recognition technology pptGesture recognition technology ppt
Gesture recognition technology pptAbhipsa Biswal
 
JARVIS - The Digital Life Assistant
JARVIS - The Digital Life AssistantJARVIS - The Digital Life Assistant
JARVIS - The Digital Life Assistantpavan kumar
 
Seminar ppt on google cardboard
Seminar ppt on google cardboardSeminar ppt on google cardboard
Seminar ppt on google cardboardPankaj Kushwaha
 
Microelectronic pill
Microelectronic pillMicroelectronic pill
Microelectronic pilldebabratrath
 
3d passwords
3d passwords3d passwords
3d passwordsshwetaag
 

La actualidad más candente (20)

Sixth Sense Seminar ppt
Sixth Sense Seminar pptSixth Sense Seminar ppt
Sixth Sense Seminar ppt
 
Sixth sense technology
Sixth sense technology Sixth sense technology
Sixth sense technology
 
Ambient intelligence (AmI)
 Ambient intelligence (AmI)  Ambient intelligence (AmI)
Ambient intelligence (AmI)
 
Virtual Surgery
Virtual SurgeryVirtual Surgery
Virtual Surgery
 
Wearable computers
Wearable computersWearable computers
Wearable computers
 
Augment your reality with ARCore !
Augment your reality with ARCore !Augment your reality with ARCore !
Augment your reality with ARCore !
 
Virtual Personal Assistant
Virtual Personal AssistantVirtual Personal Assistant
Virtual Personal Assistant
 
Augmented reality
Augmented realityAugmented reality
Augmented reality
 
Gesture recognition technology ppt
Gesture recognition technology pptGesture recognition technology ppt
Gesture recognition technology ppt
 
Biometrics Security System
Biometrics Security SystemBiometrics Security System
Biometrics Security System
 
Bio-metrics Technology
Bio-metrics TechnologyBio-metrics Technology
Bio-metrics Technology
 
Biometrics
BiometricsBiometrics
Biometrics
 
JARVIS - The Digital Life Assistant
JARVIS - The Digital Life AssistantJARVIS - The Digital Life Assistant
JARVIS - The Digital Life Assistant
 
Java ring
Java ring   Java ring
Java ring
 
Seminar ppt on google cardboard
Seminar ppt on google cardboardSeminar ppt on google cardboard
Seminar ppt on google cardboard
 
Microelectronic pill
Microelectronic pillMicroelectronic pill
Microelectronic pill
 
Haptic Technology
Haptic Technology Haptic Technology
Haptic Technology
 
Project soli
Project  soliProject  soli
Project soli
 
3d passwords
3d passwords3d passwords
3d passwords
 
Finger vein technology
Finger vein technologyFinger vein technology
Finger vein technology
 

Destacado

서버 푸쉬 (c#)
서버 푸쉬   (c#) 서버 푸쉬   (c#)
서버 푸쉬 (c#) Shon Parker
 
푸시윙 - 앱이 없는 웹사이트를 위한 무료 푸시 알림 서비스
푸시윙 - 앱이 없는 웹사이트를 위한 무료 푸시 알림 서비스푸시윙 - 앱이 없는 웹사이트를 위한 무료 푸시 알림 서비스
푸시윙 - 앱이 없는 웹사이트를 위한 무료 푸시 알림 서비스Hyun-Seok Lee
 
GCM Android
GCM AndroidGCM Android
GCM Androidaswapnal
 
Iris-iPNS / 푸시 솔루션 (Push Solution) 제품 소개
Iris-iPNS / 푸시 솔루션 (Push Solution)  제품 소개Iris-iPNS / 푸시 솔루션 (Push Solution)  제품 소개
Iris-iPNS / 푸시 솔루션 (Push Solution) 제품 소개현용 황
 
[Td 2015]개발하기 바쁜데 푸시서버와 메시지큐는 있는거 쓸래요(김영재)
[Td 2015]개발하기 바쁜데 푸시서버와 메시지큐는 있는거 쓸래요(김영재)[Td 2015]개발하기 바쁜데 푸시서버와 메시지큐는 있는거 쓸래요(김영재)
[Td 2015]개발하기 바쁜데 푸시서버와 메시지큐는 있는거 쓸래요(김영재)Sang Don Kim
 

Destacado (6)

서버 푸쉬 (c#)
서버 푸쉬   (c#) 서버 푸쉬   (c#)
서버 푸쉬 (c#)
 
푸시윙 - 앱이 없는 웹사이트를 위한 무료 푸시 알림 서비스
푸시윙 - 앱이 없는 웹사이트를 위한 무료 푸시 알림 서비스푸시윙 - 앱이 없는 웹사이트를 위한 무료 푸시 알림 서비스
푸시윙 - 앱이 없는 웹사이트를 위한 무료 푸시 알림 서비스
 
GCM Android
GCM AndroidGCM Android
GCM Android
 
Iris-iPNS / 푸시 솔루션 (Push Solution) 제품 소개
Iris-iPNS / 푸시 솔루션 (Push Solution)  제품 소개Iris-iPNS / 푸시 솔루션 (Push Solution)  제품 소개
Iris-iPNS / 푸시 솔루션 (Push Solution) 제품 소개
 
Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging
 
[Td 2015]개발하기 바쁜데 푸시서버와 메시지큐는 있는거 쓸래요(김영재)
[Td 2015]개발하기 바쁜데 푸시서버와 메시지큐는 있는거 쓸래요(김영재)[Td 2015]개발하기 바쁜데 푸시서버와 메시지큐는 있는거 쓸래요(김영재)
[Td 2015]개발하기 바쁜데 푸시서버와 메시지큐는 있는거 쓸래요(김영재)
 

Similar a Google Cloud Messaging

google cloud messaging
google cloud messaginggoogle cloud messaging
google cloud messagingBhavana Sharma
 
Introduction to google cloud messaging in android
Introduction to google cloud messaging in androidIntroduction to google cloud messaging in android
Introduction to google cloud messaging in androidRIA RUI Society
 
GCM Technology for Android
GCM Technology for AndroidGCM Technology for Android
GCM Technology for AndroidRanjitha R_14
 
GCM with Pushbots
GCM with PushbotsGCM with Pushbots
GCM with PushbotsAshish RAj
 
Максим Щеглов - Google Cloud Messaging for Android
Максим Щеглов - Google Cloud Messaging for AndroidМаксим Щеглов - Google Cloud Messaging for Android
Максим Щеглов - Google Cloud Messaging for AndroidUA Mobile
 
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...ijistjournal
 
Gcm presentation
Gcm presentationGcm presentation
Gcm presentationNiraj Singh
 
Building a chat app with windows azure mobile
Building a chat app with windows azure mobileBuilding a chat app with windows azure mobile
Building a chat app with windows azure mobileFlavius-Radu Demian
 
Automate+ Final Presentation
Automate+ Final PresentationAutomate+ Final Presentation
Automate+ Final PresentationSanat Maharjan
 
Android Cloud To Device Messaging
Android Cloud To Device MessagingAndroid Cloud To Device Messaging
Android Cloud To Device MessagingFernando Cejas
 
Android cloud to device messaging
Android cloud to device messagingAndroid cloud to device messaging
Android cloud to device messagingFe
 
GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017ketan Bordekar
 
Android push-applications-android
Android push-applications-androidAndroid push-applications-android
Android push-applications-androidwadise
 

Similar a Google Cloud Messaging (20)

google cloud messaging
google cloud messaginggoogle cloud messaging
google cloud messaging
 
Introduction to google cloud messaging in android
Introduction to google cloud messaging in androidIntroduction to google cloud messaging in android
Introduction to google cloud messaging in android
 
GCM aperitivo Android
GCM aperitivo AndroidGCM aperitivo Android
GCM aperitivo Android
 
GCM Technology for Android
GCM Technology for AndroidGCM Technology for Android
GCM Technology for Android
 
GCM with Pushbots
GCM with PushbotsGCM with Pushbots
GCM with Pushbots
 
A Journey into Google Cloud Messaging
A Journey into Google Cloud MessagingA Journey into Google Cloud Messaging
A Journey into Google Cloud Messaging
 
google cloud messaging
google cloud messaginggoogle cloud messaging
google cloud messaging
 
Максим Щеглов - Google Cloud Messaging for Android
Максим Щеглов - Google Cloud Messaging for AndroidМаксим Щеглов - Google Cloud Messaging for Android
Максим Щеглов - Google Cloud Messaging for Android
 
Magda badita gcm
Magda badita  gcmMagda badita  gcm
Magda badita gcm
 
Workshop: Android
Workshop: AndroidWorkshop: Android
Workshop: Android
 
GCM for Android
GCM for AndroidGCM for Android
GCM for Android
 
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
GOOGLE CLOUD MESSAGING (GCM): A LIGHT WEIGHT COMMUNICATION MECHANISM BETWEEN ...
 
Gcm presentation
Gcm presentationGcm presentation
Gcm presentation
 
AutoMate+
AutoMate+AutoMate+
AutoMate+
 
Building a chat app with windows azure mobile
Building a chat app with windows azure mobileBuilding a chat app with windows azure mobile
Building a chat app with windows azure mobile
 
Automate+ Final Presentation
Automate+ Final PresentationAutomate+ Final Presentation
Automate+ Final Presentation
 
Android Cloud To Device Messaging
Android Cloud To Device MessagingAndroid Cloud To Device Messaging
Android Cloud To Device Messaging
 
Android cloud to device messaging
Android cloud to device messagingAndroid cloud to device messaging
Android cloud to device messaging
 
GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017
 
Android push-applications-android
Android push-applications-androidAndroid push-applications-android
Android push-applications-android
 

Último

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Último (20)

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Google Cloud Messaging

  • 2. Introduction Google Cloud Messaging for Android (GCM):  Its a service that helps developers send data from servers to their Android applications on Android devices.  It could be a lightweight message telling application to fetch new data, or a message with payload data to be consumed instantly.  GCM handles all aspects of queuing of messages and ensures delivery to the application on target devices up to a great extent.  The best part, its totally free irrespective of your needs and has No Quota system as we had with version of C2DM.  It’s a replacement to C2DM, which is now deprecated. As no more C2DM signups are acceptable.  Provides backward support for devices running on Android 2.2 OS version. Pre OS-Ver 3.x devices, it requires to setup at least on Google account. Which is not at all required for devices running Ver-4.0 and above. 1
  • 3. GCM Architecture  Components: physical entities – Mobile Device (running with 2.2 or above OS Version) – 3rd Party App Server – GCM Servers  Credentials: to ensure approved sender and delivery to correct place – SenderID (ProjectID) – ApplicationID – RegistrationID – Google Account: if device running below ICS version. – Sender Auth Token 2
  • 4. Enabling GCM: Registration @Override protected void onCreate(Bundle saveInstanceState){ if( GCMRegistrar.getRegistrationId(this).equals(“”)){ GCMRegistrar. Register(this, “965748474884”); } } @Override protected void onRegistered(Context ctx, String regId){ sendToFootballServer(regId); } 3
  • 5. How GCM Server works? (Receiving/Sending) Content-Type:application/json Authorization:key=AIzaSyB-1uEai2WiUapxCs2Q0GZYzPu7Udno5aA { “registration_ids” : [“APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...”], “data” : { “Team” : “Portugal”, “Score” : “3”, “Player” : “Varela”, }, } 4
  • 6. Sending a Message:  The application server issues a POST request to https://android.googleapis.com/gcm/send HttpRequest :Body(JSON) { "collapse_key": "score_update", "time_to_live": 108, “delay_while_idle": true, "data": { "score": "4x8", "time": "15:16.2342" }, "registration_ids":["4", "8", "15", "16", "23", "42"] } HttpResponse:Body(JSON) { "multicast_id": 216, "success": 3, "failure": 3, "canonical_ids": 1, "results": [ { "message_id": "1:0408" }, { "error": "Unavailable" }, { "error": "InvalidRegistration" }, { "message_id": "1:1516" }, { "message_id": "1:2342", "registration_id": "32" }, { "error": "NotRegistered"} ] } 5
  • 7. Uniqueness of GCM: Features  Message Multicasting – More than 1 devices can receive one message simultaneously  Multiple Senders with Single RegID – More than 1 server can send messages to one App  TTL : Time To Live – Expiry of sent messages  Messages with Payload – To avoid sync with server for certain needs.  Throttle Queue – GCM Optimization for battery  GCM Reliability 6
  • 8. Message Multicasting  One Message Request – Many Devices  Up to 1000 Devices simultaneously 7
  • 9. Multiple Senders  One common Registration ID  Multiple sender can send messages to one Application  Up to 100 Project IDs (Servers) @Override protected void onCreate(Bundle savedInstanceState) { if (GCMRegistrar.getRegistrationId(this).equals(“”)) { GCMRegistrar.register(this, “968350041068”, “652183961211”); } 8
  • 10. TTL: Time To Live  Indicates the duration to which GCM can store this message.  From 0 sec to 4 weeks  Messages with 0 will not be stored on GCM (Receive – Send – Delete)  Default is 4 Weeks  Best Use case for Advertisements( Like sending deals and offers during football match) 9
  • 11. Messages with Payload  Payload up to 4K per message  Up to 100 Messages can be stored  Deletes all and creates a message to trigger sync after that  Best use for Ims and Online Server Gaming Apps { “message_type” : “deleted_messages”, “total_deleted” : “115”, }, 10
  • 12. GCM Optimization  Throttle Queue – Provide fresh data all the time. – Optimized for battery life. – Delay in Delivery  Reliability 11