GCM GOOGLE CLOUD MESSAGING



Similar documents
Mobile Push Architectures

Google Developer Group Perugia DevFest Central Rome

Cloud to Device Messaging with Voice Notification Using GCM

A Case Study of an Android* Client App Using Cloud-Based Alert Service

GCM for Android Setup Guide

1 Overview Configuration on MACH Web Portal 1

Using the Push Notifications Extension Part 1: Certificates and Setup

Salesforce Mobile Push Notifications Implementation Guide

zevent Mobile Application

Salesforce Mobile Push Notifications Implementation Guide

Sharp.Xmpp, a multiplatform.net XMPP client library, and Android

Deploying Management and Security Agents to Mobile Devices. Deploying Mgmt and Security Agents

Monetize your Apps with no fee for your users.

CLOUD MESSAGING FOR ANDROID IS A PUSH NOTIFICATION SERVICE

ios Application Development &

Real Life Oracle Mobile Application Framework. Things that you don't get from the developer guide

Enterprise Mobile App Management Essentials. Presented by Ryan Hope and John Nielsen

Checklist: 5 Essential BaaS Features Every Mobile App Needs

ZENworks Mobile Management 3.0.x Deployment Quick Start

Developer Guide: REST API Applications. SAP Mobile Platform 2.3 SP03

AppConnect FAQ for MobileIron Technology Partners! AppConnect Overview

RESTful web services & mobile push architectures

Develop PHP mobile apps with Zend Framework

DevOps Best Practices for Mobile Apps. Sanjeev Sharma IBM Software Group

BERLIN. 2015, Amazon Web Services, Inc. or its affiliates. All rights reserved

PaaS - Platform as a Service Google App Engine

HYBRID CLOUD SUPPORT FOR LARGE SCALE ANALYTICS AND WEB PROCESSING. Navraj Chohan, Anand Gupta, Chris Bunch, Kowshik Prakasam, and Chandra Krintz

Cloud Computing and Amazon Web Services. CJUG March, 2009 Tom Malaher

TrustDefender Mobile Technical Brief

Integrating Mobile apps with your Enterprise

GOOGLE MOBILE ANALYTICS INTEGRATION. JANUARY 2013 (App version onwards)

Enterpise Mobility Lexicon & Terminology

QGDocs Documentation. Release 1.0. QuantumGraph Engineers

Creating Enterprise Mobile Apps with Red Hat

Open Source Technologies on Microsoft Azure

Cloud Powered Mobile Apps with Azure

8 Things to Know. App Developer. 8 Things to Know Before You Hire Your App Developer v1.1 Copyright 2014, Feltpad, Inc.

Enterprise Mobility Management Migration Migrating from Legacy EMM to an epo Managed EMM Environment. Paul Luetje Enterprise Solutions Architect

Building a Continuous Integration Pipeline with Docker

Platform Overview! 8 November 2013

BES10 Cloud architecture and data flows

Mobile Application Development

How To Develop Smart Android Notifications using Google Cloud Messaging Service

Mobile App Framework For any Website

Cisco Stadiumvision Mobile Software Development Kit

Configuration Guide. BlackBerry Enterprise Service 12. Version 12.0

SAP Mobile - Webinar Series SAP Mobile Platform 3.0 Security Concepts and Features

Amazon Simple Notification Service. Developer Guide API Version

Administering Jive Mobile Apps

Ludovic THUIN Technical Support Engineer. Serge WAUTIER Software R&D Manager

Building A Self-Hosted WebRTC Project

Google Cloud Print Administrator Configuration Guide

IBM MobileFirst Hands-on Labs environment with Linux on z Systems and z/os

tibbr Now, the Information Finds You.

Building Secure Mobile Applications Using MaaS360 SDK and IBM Worklight

TWO-WAY & SMS MESSAGING SMS WEB SERVICE. Product White Paper. Website: Telephone: enquiries@m-science.

What's New in Sametime 8.5. Roberto Chiabra IBM Certified IT Specialist

Building Cloud-powered Mobile Apps

Inspire, engage and connect with your audience

Frequently Asked Questions. Frequently Asked Questions SSLPost Page 1 of 31 support@sslpost.com

Getting Started Guide for Developing tibbr Apps

Gathering customer information from a mobile application James Adams, SAS Institute Inc.

Chatbots 3.3. Chatbots in Web Applications with RiveScript. Presented by Noah Petherbridge

Resource Utilization of Middleware Components in Embedded Systems

DOCUMENT REFERENCE: SQ EN. SAMKNOWS SMARTPHONE-BASED TESTING SamKnows App for Android White Paper. May 2015

Apache Karaf in real life ApacheCon NA 2014

Configuration Guide BES12. Version 12.2

Background. Personal cloud services are gaining popularity

Android Developer Fundamental 1

Phone Pal: Remote Mobile Access through Short Message Service Prof. Mitul K. Patel 1 Gadhiya Janki D. 2

Introduction to FileWave

The fabryq IoT prototyping platform

An Oracle White Paper Dec Oracle Access Management OAuth Service

Integrating Web Messaging into the Enterprise Middleware Layer

Cloud computing - Architecting in the cloud

WebLogic & Coherence. Best backend for Mobile Apps. July 2014 INSERT PRESENTER TITLE AND DATE

High Performance Messaging for Web-based Trading Systems. Frank Greco Director of Technology, Kaazing

Introduction to IBM Worklight Mobile Platform

MS 10978A Introduction to Azure for Developers

ITP 342 Mobile App Development. APIs

Android In The Cloud: A New PaaS Computing Platform

Building native mobile apps for Digital Factory

ENTERPRISE MOBILE BACKEND AS A SERVICE EVALUATION CHECKLIST

Introduction to MQTT. May 15th /05/2013 1

Mobile Application Development

ITP 342 Mobile App Development. Notifications

Configuration Guide BES12. Version 12.1

socketio Documentation

Course Summary. Prerequisites

Transcription:

GCM GOOGLE CLOUD MESSAGING By +Dennis Geurts / @dennisgggg

ABOUT ME +Dennis Geurts Software Architect at Luminis Co-organizer Dutch Android User Group

LUMINIS 120+ skilled colleages software and interaction design Arnhem, Apeldoorn, Rotterdam,...

DUTCH AUG +Johan Pelgrim, +Wiebe Elsinga, +Hugo Visser and me Started november 2011 Foundation since feb 2013 GDG since may 2013 Dutch focus, Dutch spread

MAIN SPONSORS

SOCIAL MEDIA WWW.DUTCHAUG.ORG @DutchAUG / #dutchaug +The Dutch Android User Group The Dutch Android User Group

UPCOMING EVENTS June 27th Proguard and Jenkins Amersfoort August? Social meetup Utrecht

OVERVIEW 1. What is GCM 2. Why you should use GCM 3. Third party server role 4. How to use GCM 5. Pitfalls 6. Google I/O 2013 - new features(!)

WHAT IS GCM

GOOGLE CLOUD MESSAGING leverages in-app push notifications queueing and delivery handled by GCM the Android app does not have to be active

GOOGLE CLOUD MESSAGING similar to Apple Push Notification Service multicast message support

GOOGLE CLOUD MESSAGING send payload data send notifications ('send-to-sync') blazingly fast

GOOGLE CLOUD MESSAGING payload maximum 4K message discarded after 4 weeks message can be overwritten [collapsed] delay message delivery

GOOGLE CLOUD MESSAGING STATS...

WHY SHOULD YOU USE GCM PUSH VS PULL APPLICATION FLOW

PUSH VS PULL INSTANT NOTIFICATION POLL FREQUENCY BANDWIDTH USAGE (COSTS) BATTERY USE PULL

PUSH VS PULL POLL FREQUENCY INSTANT NOTIFICATION BANDWIDTH USAGE (COSTS) BATTERY USE PULL

PUSH VS PULL INSTANT NOTIFICATION BANDWIDTH USAGE (COSTS) PUSH BATTERY USE

APPLICATION FLOW SIMPLE LESS CODE MESSAGE DELIVERY NOT GUARANTEED

GCM FLOW

CREATE A GOOGLE API PROJECT

GOOGLE API PROJECT ENABLE GCM SERVICE NOTE THE PROJECT ID NOTE THE API ACCESS KEY

THE THIRD PARTY SERVER

THIRD PARTY SERVER ROLE keep track of registered devices send messages through GCM to registered devices depends upon application's purpose

TRACK REGISTERED DEVICES totally up to the 3rd party developer Android device must notify 3rd party server

INTERACT WITH GCM SERVER HTTP (REST) interface Helper libraries Java Python Node.js...

INTERACT WITH GCM SERVER JAVA GIST //create GCM the message Message msg = new Message.Builder().timeToLive(300).collapseKey("welcome_message");.addData("type", "message").adddata("message", "hello from Mobile Down South").build(); //send GCM the message Sender sender = new Sender(System.getProperty("GCM_KEY")); MulticastResult result = sender.send(msg, regids, 5); //process result...

INTERACT WITH GCM SERVER CHECK SERVER RESPONSE canonical ids are returned for out-dated registration ids

HOW TO USE GCM THE ANDROID SIDE OF IT... supports Froyo [2.2] and up

UPDATE THE MANIFEST... CREATE A PERMISSION <pkg-name>.permission.c2d_message

UPDATE THE MANIFEST... USE SOME PERMISSIONS com.google.android.c2dm.permission.receive <pkg-name>.permission.c2d_message INTERNET GET_ACCOUNTS WAKE_LOCK

CREATE A RECEIVER AND SERVICE... TO PROCESS INCOMING MESSAGES

GOOGLE PROVIDES... GCM.JAR (IN SDK/EXTRAS/GOOGLE/GCM) GCMRegistrar - utility class GCMBroadcastReceiver - complete receiver GCMBaseIntentService - utility service

GCM REGISTRAR to register the device to unregister the device track device registration on 3rd party server

REGISTER YOUR DEVICE Log.i(TAG, "Mainactivity.register()"); if (!GCMRegistrar.isRegistered(this)) { GCMRegistrar.register(this, getresources().getstring(r.string.gcm_sender_id)); } else if (!GCMRegistrar.isRegisteredOnServer(this)) { //custom class ThirdPartyServerApi.register(this); }

GCM BASE INTENT SERVICE onregistered onunregistered onmessage onerror

GCM BASE INTENT SERVICE onregistered(context context, String registrationid) { Log.v("GIS", "onregistered()"); //custom code ThirdPartyServerApi.register(this); } onunregistered(context context, String registrationid) { Log.v("GIS", "onunregistered()"); //custom code ThirdPartyServerApi.unregister(this, registrationid); }

GCM BASE INTENT SERVICE onregistered onunregistered onmessage onerror

ON MESSAGE INTENT EXTRAS contains the payload sent by the 3rd party server

WHAT NEXT? USE THE INTENT DATA TO update internal state fetch data from 3rd party server serve a notification to the user

PITFALLS BOOK KEEPING

BOOK KEEPING track registration ids process canonical ids

GOOGLE I/O 2013 NEW FEATURES!! XMPP device push [to 3rd party server] notifications [to multiple devices]

GOOGLE I/O 2013

GOOGLE I/O 2013 XMPP persistent connection to GCM server asynchronous bi-directional up to 10 connections! ACK / NACK messages

GOOGLE I/O 2013 CONTINUOUS CONNECTION

GOOGLE I/O 2013 DEVICE PUSH (UPSTREAM)

GOOGLE I/O 2013 DEVICE PUSH (UPSTREAM) respond to 3rd party server 'ask' for data no custom HTTP interface required

GOOGLE I/O 2013 GoogleCloudMessaging gcm = GoogleCloudMessaging.get(context); String GCM_SENDER_ID = "Your-Sender-ID"; AtomicInteger msgid = new AtomicInteger(); String id = Integer.toString(msgId.incrementAndGet()); Bundle data = new Bundle(); data.putstring("hello", "Mobile Down South"); // "time to live" parameter int ttl = [0 seconds, 4 weeks] gcm.send(gcm_sender_id+"@gcm.googleapis.com", id, ttl, data);

GOOGLE I/O 2013 NOTIFICATIONS TO MULTIPLE DEVICES e.g. dismiss [Android] notifications

GOOGLE I/O 2013 HELPER LIBRARY available in play services lib backwards compatible to Froyo

GOOGLE I/O 2013 NEW FEATURES XMPP not yet available to the general public...

?? THE END?? QUESTIONS