Push it! How touse
Google Cloud Messaging
in your Androidapp
#SDK Achim Fischer
droidconGreece Thessaloniki
10-12 Septembe...
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
Websi...
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
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Push it! How to use Google Cloud Messaging in your Android App
Nächste SlideShare
Wird geladen in …5
×

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

1.281 Aufrufe

Veröffentlicht am

This presentation covers everything from Google Cloud Messaging (GCM) introduction and use cases to a ready to use client (Android app) and server (PHP implementation) examples

Veröffentlicht in: Mobil
0 Kommentare
1 Gefällt mir
Statistik
Notizen
  • Als Erste(r) kommentieren

Keine Downloads
Aufrufe
Aufrufe insgesamt
1.281
Auf SlideShare
0
Aus Einbettungen
0
Anzahl an Einbettungen
88
Aktionen
Geteilt
0
Downloads
22
Kommentare
0
Gefällt mir
1
Einbettungen 0
Keine Einbettungen

Keine Notizen für die Folie
  • Joke with "Push It!" reference to Salt & Peppa song
  • 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.
  • What are you doing after you published an article?
  • Your tweet does not get much attention
  • Solution: Have an app for that 
  • App screenshot with notification. They can’t miss that!
    I may swipe it away but if it’s interesting, I will read it.
  • PHP Website example
  • The 3 party call: Show the Flow! 1, 2, 3, 4, 5, 
  • 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
  • PHP Website example
  • The Google part
  • Create project and note the project id
  • Create project and note the project number
  • Create project and note the project id
  • Create project and note the project id
  • Android App example
  • Android App
  • Android App
  • Android App
  • Android App
  • Android App
  • Android App
  • PHP Website example
  • PHP Website example
  • Get Browser API Key from Google
  • config.php
  • Textarea, hidden field with registration ids and an action (100 for a message here)
  • Send notification. You should check for return codes here. Example: App uninstalled -> Error-return code for that reg_id.
  • Everything went fine -> cool notifications
  • Push it! How to use Google Cloud Messaging in your Android App

    1. 1. Push it! How touse Google Cloud Messaging in your Androidapp #SDK Achim Fischer droidconGreece Thessaloniki 10-12 September 2015
    2. 2. Nois e
    3. 3. Solution Step 1: Write an app for that!
    4. 4. Solution Step 2: Push the news to their devices!
    5. 5. How does it work?
    6. 6. 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
    7. 7. Google Device Website 1. Send Message with Reg Ids to Google 2. Send Message to Devices Part 2
    8. 8. Google
    9. 9. https://console.developers.google.com
    10. 10. Device
    11. 11. BroadcastReceiver
    12. 12. GcmIntentService
    13. 13. SendNotification
    14. 14. MainActivity 1/3
    15. 15. MainActivity 2/3
    16. 16. MainActivity 3/3 http://www.yourserver.com/api/register_device?api_key=1234&reg_id=123456789 0
    17. 17. Website
    18. 18. Check Return- Codes!!!
    19. 19. github.com/codingfish/gcm-client github.com/codingfish/gcm- server GitHub
    20. 20. Achim Fischer Codingfish www.codingfish.com Thank you! droidconGreeceThessaloniki

    ×