<p dir="ltr">Quite so. But onsucess, onerror is a pretty standard lingo...</p>
<div class="gmail_quote">Em 26/02/2014 13:27, "Matthias Wessendorf" <<a href="mailto:matzew@apache.org">matzew@apache.org</a>> escreveu:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 26, 2014 at 1:58 PM, Miguel Lemos <span dir="ltr"><<a href="mailto:miguel21op@gmail.com" target="_blank">miguel21op@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>I think there's no problem with the success handler as it is. Besides, it's handy and important the information we get from it. Why change what's working just fine?<br>
</div></div></blockquote><div><br></div><div>Well, Eriks suggestion does make the plugin a lot simpler. As said in other emails: since there is an error-callback (for errors when during registration with the UnifiedPush Server), this is pretty much enough to know. success _and_ error is somewhat redundant.</div>
<div><br></div><div>-Matthias</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br>Enviado do meu iPhone</div><div><br>No dia 26/02/2014, às 10:26, Erik Jan de Wit <<a href="mailto:edewit@redhat.com" target="_blank">edewit@redhat.com</a>> escreveu:<br>
<br></div><div><div><blockquote type="cite"><div><div><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 style="word-wrap:break-word"><div><pre style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:13px;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(221,221,221);line-height:19px;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;word-wrap:normal;color:rgb(51,51,51)">
<span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">push</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">.</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">register</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">(</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">onNotification</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">,</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)"> </span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">errorHandler</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">,</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)"> </span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">{</span><span style="font-size:12px;color:rgb(221,17,68);line-height:16.799999237060547px;background-color:rgb(255,255,255)">"badge"</span><span style="font-size:12px;font-weight:bold;line-height:16.799999237060547px;background-color:rgb(255,255,255)">:</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)"> </span><span style="font-size:12px;color:rgb(221,17,68);line-height:16.799999237060547px;background-color:rgb(255,255,255)">"true"</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">,</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)"> </span><span style="font-size:12px;color:rgb(221,17,68);line-height:16.799999237060547px;background-color:rgb(255,255,255)">"sound"</span><span style="font-size:12px;font-weight:bold;line-height:16.799999237060547px;background-color:rgb(255,255,255)">:</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)"> </span><span style="font-size:12px;color:rgb(221,17,68);line-height:16.799999237060547px;background-color:rgb(255,255,255)">"true"</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">,</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)"> </span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">pushConfig</span><span style="font-size:12px;font-weight:bold;line-height:16.799999237060547px;background-color:rgb(255,255,255)">:</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)"> </span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">pushConfig</span><span style="font-size:12px;line-height:16.799999237060547px;background-color:rgb(255,255,255)">});</span></pre>
</div><div><span>Now the Javascript can verify that the callback is a function because it’s no longer a string and the need for a separate successHandler is overrated as you will either get messages or your errorHandler gets invoked. </span></div>
</div></blockquote><div><br></div><div>True but it would be nice if we can still pass optionally a function for the registration successHandler, depending on the developer needs maybe I still wants to do something with his backend once the registration is suceesful. But I agree to have a default "hidden" function for that ... but should be able to override it. </div>
</div></div></div></blockquote><div><br></div><div>Unfortunately we can’t have both, either we have a successHandler or not. But really what do you want to do with your backend that depends on the successful registration with UPS? </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 style="word-wrap:break-word"><div><span><br></span></div>
<div><span>For iOS we have these badge and sound flags we could we get rid of those as well? When you don’t want a badge then just don’t send it in the message!? Then the pushConfig can be inlined making it look like this:</span></div>
</div></blockquote><div><br></div><div>Not really understand here what you mean, could you elaborate a bit ? </div></div></div></div></blockquote><div><br></div><div>On iOS when you register you can add flags to enable badges (little numbers on the app icon) and sounds so if the message contains a badge but you have registered it with badge = false the badge will be ignored. The user can also change these settings. So I suggest to always set them to true and if you don’t want to use a badge just don’t put it in the message.</div>
<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 style="word-wrap:break-word">
<div><span><pre style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:13px;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(221,221,221);line-height:19px;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;word-wrap:normal;color:rgb(51,51,51)">
<pre style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16.799999237060547px;width:744px;margin-top:0px;margin-bottom:0px;padding:0px;background-color:rgb(255,255,255)"><div>
<span>push</span><span>.</span><span>register</span><span>(</span><span>onNotification</span><span>,</span> <span>errorHandler</span><span>,</span> <span>{</span><span style="line-height:16.799999237060547px"> </span></div>
<div> <span style="color:rgb(153,153,136);font-style:italic">// senderID is only used in the Android/GCM case</span></div><div> <span>senderID</span><span style="font-weight:bold">:</span> <span style="color:rgb(221,17,68)">"<senderID e.g Google Project ID only for android>"</span><span>,</span></div>
<div> <span>pushServerURL</span><span style="font-weight:bold">:</span> <span style="color:rgb(221,17,68)">"<pushServerURL e.g http(s)//host:port/context >"</span><span>,</span></div><div> <span>variantID</span><span style="font-weight:bold">:</span> <span style="color:rgb(221,17,68)">"<variantID e.g. 1234456-234320>"</span><span>,</span></div>
<div> <span>variantSecret</span><span style="font-weight:bold">:</span> <span style="color:rgb(221,17,68)">"<variantSecret e.g. 1234456-234320>"</span><span>,</span></div><div> <span>alias</span><span style="font-weight:bold">:</span> <span style="color:rgb(221,17,68)">"<alias e.g. a username or an email address optional>"</span></div>
<div><span>});</span></div></pre></pre><div>Till now all these changes can be made on the plugin, but we could take it even further. Two things that are still platform dependent the senderId and the variantID/secret. Now senderId is ‘known’ by UPS so why do we need to specify it here? We could make senderId part of the response when registering a device on UPS then the client doesn’t need to specify it and all configuration is in one place.</div>
</span></div></div></blockquote><div><br></div><div>That will be a convention to skip the senderId when the variant is an Android "type", yeah why not, I like that. </div></div></div></div></blockquote><div><br>
</div><div>I’m not sure that I follow you, but what I meant is to change the android push registration logic see here:</div><div><a href="https://github.com/aerogear/aerogear-android/blob/2db7eedd234aa8b2b970620f1c06467baafffcb8/src/org/jboss/aerogear/android/impl/unifiedpush/AeroGearGCMPushRegistrar.java#L102" target="_blank">https://github.com/aerogear/aerogear-android/blob/2db7eedd234aa8b2b970620f1c06467baafffcb8/src/org/jboss/aerogear/android/impl/unifiedpush/AeroGearGCMPushRegistrar.java#L102</a></div>
<div><br></div><div>It uses the senderId to register itself with GCM and afterward it registers with UPS. Now if it would do that the other way around and the response of UPS would contain the senderId the client wouldn’t need to specify it.</div>
<div><br></div><div>On the cordova plugin the senderId is ignore when you are on iOS it’s only used on Android so leaving it in is not a problem, just nicer to not have it at all.</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 style="word-wrap:break-word"><span><div><br></div><div>That leaves variantID/secret and that is the boldest proposal. How about we make it possible to register for an application instead for a specific variant? Then based on the meta information (deviceType, operatingSystem and osVersion) we choose the right variant.</div>
</span></div></blockquote><div><br></div><div>I like the idea but that can be tricky since multiple variants can have the same meta information (like "Android Free"/"Android Premium"), we should think about a convention. But again I like the idea and it is worth thinking about it. </div>
</div></div></div></blockquote><div><br></div><div>Ahh didn’t think about that one, right so we could still have this when you have one variant of each type? </div></div><br></div></blockquote></div></div><div><blockquote type="cite">
<div><span>_______________________________________________</span><br><span>aerogear-dev mailing list</span><br><span><a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a></span><br>
<span><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></span></div></blockquote></div></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>_______________________________________________<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>