<div dir="ltr">+1<div><br></div><div style>that sounds like a better Option</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 7, 2013 at 8:34 AM, Christos Vasilakis <span dir="ltr">&lt;<a href="mailto:cvasilak@gmail.com" target="_blank">cvasilak@gmail.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">Hi<div><br></div><div>not sure either about providing a category and hiding the lifecycle methods. I guess, with an Xcode template that adds a &quot;Push Support Enabled&quot; option (with URL and ID fields if enabled), most of the code can be generated, leaving the users to edit at will if they wish.</div>
<div><br></div><div>Thanks,</div><div>Christos</div><div><br></div><div><div><div><div class="h5"><div>On May 6, 2013, at 10:32 PM, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt; wrote:</div>
<br></div></div><blockquote type="cite"><div><div class="h5"><div dir="ltr">One thing that we _could_ also include here, is a &quot;ag-push&quot; category for the AppDelegate class, which implements the iOS/APNs specific &quot;delegate methods&quot;.<div>
the JS/Phonegap plugin does that for it&#39;s iOS backing.<br>
</div><div><br></div><div><a href="https://github.com/phonegap-build/PushPlugin/blob/master/src/ios/AppDelegate%2Bnotification.h" target="_blank">https://github.com/phonegap-build/PushPlugin/blob/master/src/ios/AppDelegate%2Bnotification.h</a><br>

</div><div><br></div><div>Basic idea: we implement all the required hooks, for our customers/users - besides a few bits:</div><div>- URL of the server</div><div>- ID of the (iOS) variant (since that is specific to THEIR installation of the UP server)</div>

<div><br></div><div><br></div><div>Downside: I *think* overriding of that category is odd...</div><div><br></div><div><br></div><div>-Matthias </div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, May 6, 2013 at 3:20 PM, Matthias Wessendorf <span dir="ltr">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Location of the project, is currently here:<div><a href="https://github.com/matzew/ag-client-push-sdk" target="_blank">https://github.com/matzew/ag-client-push-sdk</a><br></div><div><br></div><div>API:</div>

<div>
<a href="https://github.com/matzew/ag-client-push-sdk/blob/master/push-sdk/AGDeviceRegistration.h" target="_blank">https://github.com/matzew/ag-client-push-sdk/blob/master/push-sdk/AGDeviceRegistration.h</a> </div><div><br>

</div><div>
TEST (incl. OHHTTPStubs for mocking AFNetworking):</div><div><a href="https://github.com/matzew/ag-client-push-sdk/blob/master/push-sdkTests/AGDeviceRegistrationSpec.m" target="_blank">https://github.com/matzew/ag-client-push-sdk/blob/master/push-sdkTests/AGDeviceRegistrationSpec.m</a><span><font color="#888888"><br>


</font></span></div><span><font color="#888888"><div><br></div><div><br></div><div>-Matthias</div></font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, May 6, 2013 at 11:58 AM, Matthias Wessendorf <span dir="ltr">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;margin-bottom:15px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:0px!important">


Hi,</p><p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">the client side spec describes the required functionality to register devices with the Unified Push Server.</p>
<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">The client SKD should be simple to use. For the iOS, I thought about a register that takes three blocks:</p>



<ul style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px;padding:0px 0px 0px 30px"><li>ClientDeviceInformation object/protocol (similar to our configuration objects)</li>



<li>success callback</li><li>failure callback</li></ul><div style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;padding:0px;border:0px"><pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span style="color:rgb(153,153,136);font-style:italic">// AppDelegate code/delegate function, for a push enabled application:</span>
<span style="font-weight:bold">-</span> <span>(</span><span style="color:rgb(68,85,136);font-weight:bold">void</span><span>)</span><span style="color:rgb(153,0,0);font-weight:bold">application:</span><span>(</span><span style="color:rgb(51,51,51)">UIApplication</span> <span style="font-weight:bold">*</span><span>)</span><span style="color:teal">application</span> 
   <span style="color:rgb(153,153,136);font-style:italic">// deviceToken provided by APNs</span>
   <span>didRegisterForRemoteNotificationsWithDeviceToken:</span><span>(</span><span style="color:rgb(51,51,51)">NSData</span> <span style="font-weight:bold">*</span><span>)</span><span style="color:teal">deviceToken</span> <span>{</span> 

  <span style="color:rgb(153,153,136);font-style:italic">// the AG AGDeviceRegistration helper/class:</span>
  <span>[</span><span style="color:rgb(51,51,51)">registration</span> <span style="color:rgb(51,51,51)">registerWithClientInfo</span><span style="font-weight:bold">:^</span><span>(</span><span style="color:rgb(68,85,136);font-weight:bold">id</span><span style="font-weight:bold">&lt;</span><span style="color:rgb(51,51,51)">AGClientDeviceInformation</span><span style="font-weight:bold">&gt;</span> <span style="color:rgb(51,51,51)">clientInfo</span><span>)</span> <span>{</span>
    <span style="color:rgb(153,153,136);font-style:italic">// apply the desired info:</span>
    <span style="color:rgb(51,51,51)">clientInfo</span><span>.</span><span style="color:rgb(51,51,51)">token</span> <span style="font-weight:bold">=</span> <span style="color:rgb(51,51,51)">deviceToken</span><span>;</span>
    <span style="color:rgb(51,51,51)">clientInfo</span><span>.</span><span style="color:rgb(51,51,51)">alias</span> <span style="font-weight:bold">=</span> <span style="color:rgb(221,17,68)">@&quot;<a href="mailto:mister@xyz.com" target="_blank">mister@xyz.com</a>&quot;</span><span>;</span>
    <span style="color:rgb(51,51,51)">clientInfo</span><span>.</span><span style="color:rgb(51,51,51)">mobileVariantID</span> <span style="font-weight:bold">=</span> <span style="color:rgb(221,17,68)">@&quot;123456432134564321345432&quot;</span><span>;</span>
    <span style="color:rgb(153,153,136);font-style:italic">// ... as needed more of the data;</span>
  <span>}</span> <span style="color:rgb(51,51,51)">success</span><span style="font-weight:bold">:^</span><span>(</span><span style="color:rgb(68,85,136);font-weight:bold">id</span> <span style="color:rgb(51,51,51)">responseObject</span><span>)</span> <span>{</span>
     <span style="color:rgb(153,153,136);font-style:italic">// invoked, on 200 HTTP response code from the Unified Push Server</span>
  <span>}</span> <span style="color:rgb(51,51,51)">failure</span><span style="font-weight:bold">:^</span><span>(</span><span style="color:rgb(51,51,51)">NSError</span> <span style="font-weight:bold">*</span><span style="color:rgb(51,51,51)">error</span><span>)</span> <span>{</span>
    <span style="color:rgb(153,153,136);font-style:italic">// invoked:</span>
      <span style="color:rgb(153,153,136);font-style:italic">// missing required data (e.g. no token submitted)</span>
      <span style="color:rgb(153,153,136);font-style:italic">// on 4xx/5zz HTTP response codes from the Unified Push Server</span>
<span>}];</span>
<span>}</span>
</pre></div><p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">The above <code style="font-size:12px;line-height:normal;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">registerWithClientInfo:successfailure</code> method uses <code style="font-size:12px;line-height:normal;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">AFNetworking</code> to submit the received<code style="font-size:12px;line-height:normal;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">deviceToken</code> to the <em>AeroGear Unified Push Server</em>. The desired information data is provided on the first callback.</p>
<p style="line-height:20px;font-size:13.63636302947998px;font-family:Helvetica,arial,freesans,clean,sans-serif;margin:15px 0px">The concept of a &quot;block&quot; for setting up data/objects has been useful on <code style="font-size:12px;line-height:normal;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">AGPipeConfig</code>, so reusing the concept here as well.</p>
<p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;margin-bottom:0px!important;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:15px"><strong>Note:</strong> Class/method names may change over time...</p>
<p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;margin-bottom:0px!important;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:15px">Thoughts ?</p><span><font color="#888888"><p style="line-height:20px;margin-right:0px;font-size:13.63636302947998px;margin-left:0px;margin-bottom:0px!important;font-family:Helvetica,arial,freesans,clean,sans-serif;margin-top:15px">



<br></p><div><br></div><div>-Matthias</div><div><br></div><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>
</font></span></div>
</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>
</div></div></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></div></div>
_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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></blockquote>
</div><br></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>