<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 17, 2013 at 8:29 PM, Yavuz Selim YILMAZ <span dir="ltr">&lt;<a href="mailto:yavuzsel@buffalo.edu" target="_blank">yavuzsel@buffalo.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="im"><br><div>

<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">
<br>---</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">
Yavuz Selim Yilmaz</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">
SUNY at Buffalo</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">
Computer Science and Engineering</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">
PhD Candidate</div>
</div>
<br></div><div><div><div class="h5"><div>On Jul 17, 2013, at 2:08 PM, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt; wrote:</div><br><blockquote type="cite"><div dir="ltr">
<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 17, 2013 at 7:58 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">

<div>On Wed, Jul 17, 2013 at 7:06 PM, Yavuz Selim YILMAZ <span dir="ltr">&lt;<a href="mailto:yavuzsel@buffalo.edu" target="_blank">yavuzsel@buffalo.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br><div>

<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">


<br>---</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">


Yavuz Selim Yilmaz</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">


SUNY at Buffalo</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">


Computer Science and Engineering</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">


PhD Candidate</div>
</div>
<br></div><div><div><div>On Jul 17, 2013, at 11:53 AM, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt; wrote:</div><br><blockquote type="cite"><div dir="ltr">
<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 17, 2013 at 5:44 PM, Yavuz Selim YILMAZ <span dir="ltr">&lt;<a href="mailto:yavuzsel@buffalo.edu" target="_blank">yavuzsel@buffalo.edu</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div>
<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">



<br>---</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">



Yavuz Selim Yilmaz</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">



SUNY at Buffalo</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">



Computer Science and Engineering</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">



PhD Candidate</div>
</div>
<br><div><div><div>On Jul 17, 2013, at 11:32 AM, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt; wrote:</div><br><blockquote type="cite"><div dir="ltr"><div>
On iOS we recommend doing the registration (with UP server) on the &quot;didRegisterForRemoteNotificationsWithDeviceToken&quot; callback:</div><div><a href="https://github.com/aerogear/aerogear.org/blob/master/docs/guides/aerogear-push-ios/iOS-app.asciidoc" target="_blank">https://github.com/aerogear/aerogear.org/blob/master/docs/guides/aerogear-push-ios/iOS-app.asciidoc</a></div>




<div><br></div><div><br></div><div>However, in AeroDoc-iOS, we just stash the token: <a href="https://github.com/aerogear/aerogear-push-quickstart-ios/blob/master/ProDoctor/ProDoctor/AGAppDelegate.m#L49" target="_blank">https://github.com/aerogear/aerogear-push-quickstart-ios/blob/master/ProDoctor/ProDoctor/AGAppDelegate.m#L49</a></div>




<div><br></div></div></blockquote><blockquote type="cite"><div dir="ltr"><div><br></div><div>And submit it, with the entire metadata, AFTER a successful login: <a href="https://github.com/aerogear/aerogear-push-quickstart-ios/blob/master/ProDoctor/ProDoctor/Classes/Controllers/AGLoginViewController.m#L138" target="_blank">https://github.com/aerogear/aerogear-push-quickstart-ios/blob/master/ProDoctor/ProDoctor/Classes/Controllers/AGLoginViewController.m#L138</a></div>



</div></blockquote><div><br></div></div>Is it guaranteed that device token is received BEFORE successful login? What if registration with APNs fails?</div></div></blockquote><div><br></div><div><br></div><div>a different APNs callback is invoked (<em style="color:rgb(51,51,51);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:15px;line-height:25px">application:didFailToRegisterForRemoteNotificationsWithError)</em></div>


</div></div></div></blockquote><div><br></div></div><div>Yes, but in that case, ProDoctor still registers the device to the Push EE server (with nil device token afaik). Is it an expected behavior?</div></div></div></blockquote>


<div><br></div></div><div>not really :-)</div><div>If APNs fails initially, there should be no registration with the UnifiedPush Server. The metadata, without an APNs deviceToken (where it is &#39;nil&#39;) is pretty much useless :-)</div>

</div></div></div></blockquote><div><br></div><div>I filed a bug, based on your comment :)</div></div></div></div></blockquote><div><br></div></div></div><div>\o/</div><div class="im"><br><blockquote type="cite"><div dir="ltr">
<div class="gmail_extra"><div class="gmail_quote"><div><br></div><div><a href="https://issues.jboss.org/browse/AGIOS-43" target="_blank">https://issues.jboss.org/browse/AGIOS-43</a><br></div>
<div><br></div><div>-Matthias</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br>

</div><div>And my 1st question refers to this scenario:</div><div>Application successfully registered with APNs, but the delegate called AFTER the successful login (I was asking about the time guarantee of APNs registration),</div>


</div></blockquote><div><br></div></div><div>What delegate do you mean?</div><div>The &quot;didRegisterForRemoteNotificationsWithDeviceToken&quot; delegate is called right away, regardless of what the first screen does (e.g. offering a login screen).</div>
</div></div></div></blockquote></div></div></div></blockquote><div><br></div></div><div>Yes, I&#39;m talking about &quot;didRegisterForRemoteNotificationsWithDeviceToken&quot; method. My question is, how much time are you referring with &quot;right away&quot;? Can there be some APNs delays (or something which delays this delegate call) which will cause Push EE device registration with nil device token (or no registration after bug fix)?</div>
</div></div></blockquote><div><br></div><div>Perhaps, but most-likely only when your app (e.g. AeroDoc) is the FIRST app on the iOS device that uses APNs.</div><div>After installing the first, there is a persistent connection to the APNs server, when ever you have 3G/Data.</div>
<div><br></div><div><br></div><div>I *think* if there is NO connection (to 3G/Data), the callbacks are not invoked</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div> Let me give a numerical example:</div><div><br></div><div>t=0 app is launched</div><div>t=10 user tapped login button with valid username and password</div><div>t=11 user is logged in successfully</div>
<div>t=11.x <span style="color:rgb(51,51,51);font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">[</span><span style="color:rgb(51,51,51);font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">self</span><span style="color:rgb(51,51,51);font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap;background-color:rgb(255,255,204)"> </span><span style="color:rgb(51,51,51);font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">deviceRegistration</span><span style="color:rgb(51,51,51);font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:12px;line-height:18px;white-space:pre-wrap">]; </span>is called (device token is nil)</div>
</div></div></blockquote><div><br></div><div>no registration will happen:</div><div><a href="https://github.com/aerogear/aerogear-push-ios-registration/blob/master/push-sdk/AGDeviceRegistration.m#L60">https://github.com/aerogear/aerogear-push-ios-registration/blob/master/push-sdk/AGDeviceRegistration.m#L60</a><br>
</div><div><br></div><div>(Let me close the previous bug :-)) </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div>t=11.x+n didRegisterForRemoteNotificationsWithDeviceToken is called (registered to APNs successfully and device token is stashed)</div><div><br></div><div>In this case, device will not be successfully registered to Push EE as far as I could see.</div>
</div></div></blockquote><div><br></div><div>nope, no registration at all :)</div><div><br></div><div>(also, if you kill and re-start the app a few times, a lot of &quot;registration&quot; agains PushEE are performed, to &quot;update&quot; the metadata)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div> But it should be registered as it is eventually registered to APNs successfully.</div>
<div><br></div><div>And yes, usually didRegisterForRemoteNotificationsWithDeviceToken gets called so quickly (as I&#39;ve experimented so far), but is it guaranteed?</div></div></div></blockquote><div><br></div><div>what exactly is guaranteed?</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">
<div><div> Or should AeroDoc (fka ProDoctor) handle such cases on its own?</div></div></div></blockquote><div><br></div><div>the lib protects against &#39;nil&#39; :-) </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div><div class="h5"><div><br></div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div><div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div> so in this case there exist no stashed device token at the time of the execution of the success block. In such a case, when the delegate called after successful APNs registration, device should still be registered to Push EE I think.</div>


<div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">



<div><br><blockquote type="cite"><div><div dir="ltr">
<div><br></div><div><br></div><div><br></div><div>Perhaps we could/should docment that somewhere as well ? E.g. in the tutorial doc (e.g. since that is a common use-case), or just on the AeroDoc code (with some comments) ?</div>




<div><br></div><div><br></div><div><br></div><div>-Matthias</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>
</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><br>_______________________________________________<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><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></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></div><br></div><br>_______________________________________________<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><br></blockquote></div></div></div><div><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></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>
_______________________________________________<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></div></div><br></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></div>