<div dir="ltr">Pretty cool bits and a great research project.<div><br></div><div>Once the 0.8.0 is out, in a few weeks, I do not mind adding this for a 0.9.0 or 1.0.0 release.</div><div><br></div><div>Greetings,</div><div>
Matthias</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 4, 2013 at 1:23 AM, Lucas Holmquist <span dir="ltr">&lt;<a href="mailto:lholmqui@redhat.com" target="_blank">lholmqui@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">So most of you all know my love of shiny objects.  With the release of 0.0.2 of the Admin UI,  i decided to make yesterday( friday. 8/2 ) a day about experimenting.  <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.   My first attempt back then failed, so i decided to have another go at it.  I&#39;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 style="white-space:pre-wrap">        </span>** the refresh token doesn&#39;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&#39;t to bad,  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  ).   It gets a new access token every time which as i stated before is bad.</div>
<div><br></div><div>I&#39;m not sure if we should store the access token with the timer or what. 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].  i didn&#39;t make any comments or anything it them,  just some things hacked together</div>
<div><br></div><div><br></div><div><br></div><div>I think GCM for chrome is somewhat new.  It would be cool to add this for a 1.1 release or something.  i&#39;m not really sure how much it is used,   but the more networks we can unify<span style="white-space:pre-wrap">        </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. <a href="http://developer.chrome.com/apps/cloudMessaging.html" target="_blank">http://developer.chrome.com/apps/cloudMessaging.html</a></div>
<div>2. <a href="https://github.com/lholmquist/aerogear-unified-push-server/tree/chrome" target="_blank">https://github.com/lholmquist/aerogear-unified-push-server/tree/chrome</a></div><div>3. <a href="https://github.com/lholmquist/aerogear-unified-push-server-admin-ui/tree/chrome" target="_blank">https://github.com/lholmquist/aerogear-unified-push-server-admin-ui/tree/chrome</a></div>
<div>4. <a href="https://github.com/lholmquist/chrome-app-codelab/tree/chromepush/lab2_basic" target="_blank">https://github.com/lholmquist/chrome-app-codelab/tree/chromepush/lab2_basic</a></div></div><br>_______________________________________________<br>

aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br>
<br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div>