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
10. 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
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.