SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Push it! How touse
Google Cloud Messaging
in your Androidapp
#SDK Achim Fischer
droidconGreece Thessaloniki
10-12 September 2015
Nois
e
Solution Step 1:
Write an app for that!
Solution Step 2:
Push the news to
their devices!
How does it work?
Google
Device Website
1. Create
Project
2. Register for
Messages
3. Send Reg Id to Device
4. Send Registration Id to
Website
5. Website stores Reg Ids in
Database
Part 1
Google
Device Website
1. Send Message with Reg Ids to
Google
2. Send Message to
Devices
Part 2
Google
https://console.developers.google.com
Device
BroadcastReceiver
GcmIntentService
SendNotification
MainActivity 1/3
MainActivity 2/3
MainActivity 3/3
http://www.yourserver.com/api/register_device?api_key=1234&reg_id=123456789
0
Website
Check Return-
Codes!!!
github.com/codingfish/gcm-client
github.com/codingfish/gcm-
server
GitHub
Achim Fischer
Codingfish
www.codingfish.com
Thank you!
droidconGreeceThessaloniki

Weitere ähnliche Inhalte

Was ist angesagt?

Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging Sandip Jadhav
 
Firebase Cloud Messaging Device to Device
Firebase Cloud Messaging Device to DeviceFirebase Cloud Messaging Device to Device
Firebase Cloud Messaging Device to DeviceTakuma Lee
 
GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017ketan Bordekar
 
Gcm presentation
Gcm presentationGcm presentation
Gcm presentationNiraj Singh
 
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
 
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew KurniadiID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew KurniadiDicoding
 
[Android] Services and Broadcast Receivers
[Android] Services and Broadcast Receivers[Android] Services and Broadcast Receivers
[Android] Services and Broadcast ReceiversNikmesoft Ltd
 
google cloud messaging
google cloud messaginggoogle cloud messaging
google cloud messagingBhavana Sharma
 
Effective use of amazon web services for web deployment
Effective use of amazon web services for web deploymentEffective use of amazon web services for web deployment
Effective use of amazon web services for web deploymentGhazanfar Latif (Gabe)
 
Dapr- Distrbuted Application Runtime. .Net Summit 2020_ Bangalore
Dapr- Distrbuted Application Runtime. .Net Summit 2020_ BangaloreDapr- Distrbuted Application Runtime. .Net Summit 2020_ Bangalore
Dapr- Distrbuted Application Runtime. .Net Summit 2020_ BangaloreAmresh Krishnamurthy
 

Was ist angesagt? (15)

Google Cloud Messaging
Google Cloud Messaging Google Cloud Messaging
Google Cloud Messaging
 
GCM for Android
GCM for AndroidGCM for Android
GCM for Android
 
Magda badita gcm
Magda badita  gcmMagda badita  gcm
Magda badita gcm
 
Gcm tutorial
Gcm tutorialGcm tutorial
Gcm tutorial
 
Firebase Cloud Messaging Device to Device
Firebase Cloud Messaging Device to DeviceFirebase Cloud Messaging Device to Device
Firebase Cloud Messaging Device to Device
 
GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017GOOGLE CLOUD MESSAGING PPT 2017
GOOGLE CLOUD MESSAGING PPT 2017
 
Gcm presentation
Gcm presentationGcm presentation
Gcm presentation
 
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
 
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew KurniadiID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
ID Android TechTalk Series #6 : Google Service and Gradle - Andrew Kurniadi
 
[Android] Services and Broadcast Receivers
[Android] Services and Broadcast Receivers[Android] Services and Broadcast Receivers
[Android] Services and Broadcast Receivers
 
google cloud messaging
google cloud messaginggoogle cloud messaging
google cloud messaging
 
Google cloud messaging
Google cloud messagingGoogle cloud messaging
Google cloud messaging
 
Effective use of amazon web services for web deployment
Effective use of amazon web services for web deploymentEffective use of amazon web services for web deployment
Effective use of amazon web services for web deployment
 
Dapr- Distrbuted Application Runtime. .Net Summit 2020_ Bangalore
Dapr- Distrbuted Application Runtime. .Net Summit 2020_ BangaloreDapr- Distrbuted Application Runtime. .Net Summit 2020_ Bangalore
Dapr- Distrbuted Application Runtime. .Net Summit 2020_ Bangalore
 

Andere mochten auch

Andere mochten auch (7)

Sales management
Sales management Sales management
Sales management
 
Produc market analysis
Produc market analysisProduc market analysis
Produc market analysis
 
Cyber security2015 cte vam_nekdo_za_zady_vase_e-maily
Cyber security2015 cte vam_nekdo_za_zady_vase_e-mailyCyber security2015 cte vam_nekdo_za_zady_vase_e-maily
Cyber security2015 cte vam_nekdo_za_zady_vase_e-maily
 
Ee unlocking energy efficiency white0paper
Ee unlocking energy efficiency white0paperEe unlocking energy efficiency white0paper
Ee unlocking energy efficiency white0paper
 
R Bays - HHS Releases Physician-level Medicare Data
R Bays - HHS Releases Physician-level Medicare DataR Bays - HHS Releases Physician-level Medicare Data
R Bays - HHS Releases Physician-level Medicare Data
 
R Bays CMS LSC Update
R Bays CMS LSC UpdateR Bays CMS LSC Update
R Bays CMS LSC Update
 
The Road
The Road The Road
The Road
 

Ähnlich wie Push it! How to use Google Cloud Messaging in your Android App

Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspectiveGunjan Kumar
 
Android chat in the cloud
Android chat in the cloudAndroid chat in the cloud
Android chat in the cloudfirenze-gtug
 
Google Glass - An Intro presentation to conduct code lab events.
Google Glass - An Intro presentation to conduct code lab events.Google Glass - An Intro presentation to conduct code lab events.
Google Glass - An Intro presentation to conduct code lab events.getdinesh
 
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...e-Legion
 
Jose l ugia 6 wunderkinder, momenta
Jose l ugia  6 wunderkinder, momentaJose l ugia  6 wunderkinder, momenta
Jose l ugia 6 wunderkinder, momentaapps4allru
 
Introduction to Android - Mobile Fest Singapore 2009
Introduction to Android - Mobile Fest Singapore 2009Introduction to Android - Mobile Fest Singapore 2009
Introduction to Android - Mobile Fest Singapore 2009sullis
 
Build your cross-platform service in a week with App Engine
Build your cross-platform service in a week with App EngineBuild your cross-platform service in a week with App Engine
Build your cross-platform service in a week with App EngineJl_Ugia
 
Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)Natalia Efimtseva
 
Is Your App Hackable for droidcon Berlin 2015
Is Your App Hackable for droidcon Berlin 2015Is Your App Hackable for droidcon Berlin 2015
Is Your App Hackable for droidcon Berlin 2015Licel
 
Introduction to Android - Mobile Portland
Introduction to Android - Mobile PortlandIntroduction to Android - Mobile Portland
Introduction to Android - Mobile Portlandsullis
 
Android Cloud to Device Messaging with the Google App Engine
Android Cloud to Device Messaging with the Google App EngineAndroid Cloud to Device Messaging with the Google App Engine
Android Cloud to Device Messaging with the Google App EngineLars Vogel
 
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...Amazon Web Services
 
Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009sullis
 
Android 103 - Firebase and Architecture Components
Android 103 - Firebase and Architecture ComponentsAndroid 103 - Firebase and Architecture Components
Android 103 - Firebase and Architecture ComponentsKai Koenig
 
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxLecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxNgLQun
 
App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲益祥 許
 
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any PlatformSalesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any Platformandyinthecloud
 

Ähnlich wie Push it! How to use Google Cloud Messaging in your Android App (20)

Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Android chat in the cloud
Android chat in the cloudAndroid chat in the cloud
Android chat in the cloud
 
Google Glass - An Intro presentation to conduct code lab events.
Google Glass - An Intro presentation to conduct code lab events.Google Glass - An Intro presentation to conduct code lab events.
Google Glass - An Intro presentation to conduct code lab events.
 
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
 
Jose l ugia 6 wunderkinder, momenta
Jose l ugia  6 wunderkinder, momentaJose l ugia  6 wunderkinder, momenta
Jose l ugia 6 wunderkinder, momenta
 
Introduction to Android - Mobile Fest Singapore 2009
Introduction to Android - Mobile Fest Singapore 2009Introduction to Android - Mobile Fest Singapore 2009
Introduction to Android - Mobile Fest Singapore 2009
 
Build your cross-platform service in a week with App Engine
Build your cross-platform service in a week with App EngineBuild your cross-platform service in a week with App Engine
Build your cross-platform service in a week with App Engine
 
Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)
 
Is Your App Hackable for droidcon Berlin 2015
Is Your App Hackable for droidcon Berlin 2015Is Your App Hackable for droidcon Berlin 2015
Is Your App Hackable for droidcon Berlin 2015
 
Introduction to Android - Mobile Portland
Introduction to Android - Mobile PortlandIntroduction to Android - Mobile Portland
Introduction to Android - Mobile Portland
 
Nativescript with angular 2
Nativescript with angular 2Nativescript with angular 2
Nativescript with angular 2
 
Android Cloud to Device Messaging with the Google App Engine
Android Cloud to Device Messaging with the Google App EngineAndroid Cloud to Device Messaging with the Google App Engine
Android Cloud to Device Messaging with the Google App Engine
 
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...
(MBL301) Beyond the App - Extend Your User Experience with Mobile Push Notifi...
 
Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009
 
Android 103 - Firebase and Architecture Components
Android 103 - Firebase and Architecture ComponentsAndroid 103 - Firebase and Architecture Components
Android 103 - Firebase and Architecture Components
 
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptxLecture 12 - Maps, AR_VR_aaaaHardware.pptx
Lecture 12 - Maps, AR_VR_aaaaHardware.pptx
 
App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲App開發 - Web Developer的逆襲
App開發 - Web Developer的逆襲
 
OpenMIC March-2012.phonegap
OpenMIC March-2012.phonegapOpenMIC March-2012.phonegap
OpenMIC March-2012.phonegap
 
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any PlatformSalesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
 
Flutter study jam 2019
Flutter study jam 2019Flutter study jam 2019
Flutter study jam 2019
 

Kürzlich hochgeladen

Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRnishacall1
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 

Kürzlich hochgeladen (7)

Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 

Push it! How to use Google Cloud Messaging in your Android App

Hinweis der Redaktion

  1. Joke with "Push It!" reference to Salt & Peppa song
  2. Use cases: Social Networks, Image Galleries, Messenger, News Services Lets focus on the News example. News Services don‘t wait until you start their app -> they push breaking news to your device. *** Breaking News: Droidcon Greece – Huge success!!! *** That‘s what we can do with our „normal“ websites, too.
  3. What are you doing after you published an article?
  4. Your tweet does not get much attention
  5. Solution: Have an app for that 
  6. App screenshot with notification. They can’t miss that! I may swipe it away but if it’s interesting, I will read it.
  7. PHP Website example
  8. The 3 party call: Show the Flow! 1, 2, 3, 4, 5, 
  9. Send Array with reg_ids to Google. Up to 500 reg_ids in one call. If more devices -> more calls e.g. 1500 then 3 calls with 500 reg_ids
  10. PHP Website example
  11. The Google part
  12. Create project and note the project id
  13. Create project and note the project number
  14. Create project and note the project id
  15. Create project and note the project id
  16. Android App example
  17. Android App
  18. Android App
  19. Android App
  20. Android App
  21. Android App
  22. Android App
  23. PHP Website example
  24. PHP Website example
  25. Get Browser API Key from Google
  26. config.php
  27. Textarea, hidden field with registration ids and an action (100 for a message here)
  28. Send notification. You should check for return codes here. Example: App uninstalled -> Error-return code for that reg_id.
  29. Everything went fine -> cool notifications