<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">So most of you all know my love of shiny objects. &nbsp;With the release of 0.0.2 of the Admin UI, &nbsp;i decided to make yesterday( friday. 8/2 ) a day about experimenting. &nbsp;<div><br></div><div>A while ago i started to play with Chrome Packaged Apps and sending Push messages to them with GCM for Chrome[1] and how we could integrate that service into the Unified Push Server. &nbsp; My first attempt back then failed, so i decided to have another go at it. &nbsp;I'm happy to report that i got it working this time.</div><div><br></div><div>I created a chrome branch[2] in my fork of the Push server and also a chrome branch[3] in my fork of the admin UI.</div><div><br></div><div>Just a quick rundown of how this messaging works:</div><div><br></div><div>1. you create an app in the google api console thing - same as android</div><div>2. Then you need to generate a refresh and access token - this is different than android</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>** the refresh token doesn't expire unless explicitly revoked, but the access token does every 60 minutes(?)</div><div>3. Send the message with the client id, client secret( these 2 are generated from step 1 ) and the access token</div><div><br></div><div>it is not recommend to get a new access token for every request since there is a limit.</div><div><br></div><div>Integrating this into the push server wasn't to bad, &nbsp;just tedious because of all the interfaces and such.</div><div><br></div><div>probably the crappiest code is the actual sender that i wrote( actually taken from the simple push sender &nbsp;). &nbsp; It gets a new access token every time which as i stated before is bad.</div><div><br></div><div>I'm not sure if we should store the access token with the timer or what.&nbsp;The model that i created for this has a clientId, clientSecret, and a refreshToken</div><div><br></div><div><br></div><div>here is the sample code that i threw together for receiving the notifications[4]. &nbsp;i didn't make any comments or anything it them, &nbsp;just some things hacked together</div><div><br></div><div><br></div><div><br></div><div>I think GCM for chrome is somewhat new. &nbsp;It would be cool to add this for a 1.1 release or something. &nbsp;i'm not really sure how much it is used, &nbsp; but the more networks we can unify<span class="Apple-tab-span" style="white-space:pre">        </span>the better.</div><div><br></div><div><br></div><div>-Luke</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>1.&nbsp;<a href="http://developer.chrome.com/apps/cloudMessaging.html">http://developer.chrome.com/apps/cloudMessaging.html</a></div><div>2.&nbsp;<a href="https://github.com/lholmquist/aerogear-unified-push-server/tree/chrome">https://github.com/lholmquist/aerogear-unified-push-server/tree/chrome</a></div><div>3.&nbsp;<a href="https://github.com/lholmquist/aerogear-unified-push-server-admin-ui/tree/chrome">https://github.com/lholmquist/aerogear-unified-push-server-admin-ui/tree/chrome</a></div><div>4.&nbsp;<a href="https://github.com/lholmquist/chrome-app-codelab/tree/chromepush/lab2_basic">https://github.com/lholmquist/chrome-app-codelab/tree/chromepush/lab2_basic</a></div></body></html>