<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 19, 2015 at 9:40 AM, Alex Ballesté <span dir="ltr">&lt;<a href="mailto:alexandre.balleste@udl.cat" target="_blank">alexandre.balleste@udl.cat</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 text="#000000" bgcolor="#FFFFFF">
    <div>Hi Erik, thanks for answering so
      quickly. I still have some gaps in my mind; I&#39;m sure that is
      because my inexperience in that area. Maybe I was wrong choosing
      UPS for covering use case that was not designed for but I still
      think (correct me if I&#39;m wrong) that this scenario is possible:<br>
      <br>
      Our Learning Management System (LMS) Sakai distributes users into
      &quot;sites&quot; corresponding to courses. Each student belong to many
      sites. An instructor from a course can send announcements,
      messages, upload resources, etc to a particular course site and
      those are only visible to the members of the site. <br>
      <br>
      We would like to reproduce that behaviour with UPS. When a user
      sends an announcement to site (and a checkbox is marked) it sends
      the notification to the Messaging backend who automatically sends
      the notification with an array of alias filled with the &quot;username&quot;
      of members of that site. It helps to us to limit who receives a
      notification from which site ... <br></div></div></blockquote><div><br></div><div>we have a category</div><div><br></div><div>the users device just subscribes to a category or more.</div><div><br></div><div><br></div><div><br></div><div><br></div><div>Now, on the backend, so something like:</div><div><br></div><div><div>final UnifiedMessage unifiedMessage = UnifiedMessage</div><div>    .withMessage()</div><div>       .alert(&quot;Some Text&quot;)</div><div>       .sound(&quot;default&quot;)</div><div>    .criteria()</div><div>       .categories(&quot;Class A&quot;) // or pass in more... if desired</div><div>.build();</div><div><br></div><div>sender.send(unifiedMessage, () -&gt;</div><div>    <a href="http://logger.info">logger.info</a>(&quot;successful delivery to UPS returned&quot;)</div><div>);</div></div><div><br></div><div><br></div><div><br></div><div><br></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 text="#000000" bgcolor="#FFFFFF"><div>
      <br>
      Our intention with our APP is to authenticate first, to be sure
      that is an student of our university, so registration to the UPS
      must be done when auth succeed (don&#39;t let anybody who downloaded
      the app register to the UPS if don&#39;t belong to our institution).<br></div></div></blockquote><div><br></div><div>yes, we do that too:</div><div>iOS: <a href="https://github.com/aerogear/aerogear-ios-cookbook/blob/1.6.x/AeroDoc/AeroDoc/Classes/Controllers/AGLoginViewController.m#L153-L174">https://github.com/aerogear/aerogear-ios-cookbook/blob/1.6.x/AeroDoc/AeroDoc/Classes/Controllers/AGLoginViewController.m#L153-L174</a></div><div>Andrid: <a href="https://github.com/aerogear/aerogear-android-cookbook/blob/27b9791713b9c77a2f01600ab487e8467cc62431/AeroDoc/app/src/main/java/org/jboss/aerogear/android/cookbook/aerodoc/activities/AeroDocActivity.java#L158-L167">https://github.com/aerogear/aerogear-android-cookbook/blob/27b9791713b9c77a2f01600ab487e8467cc62431/AeroDoc/app/src/main/java/org/jboss/aerogear/android/cookbook/aerodoc/activities/AeroDocActivity.java#L158-L167</a></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 text="#000000" bgcolor="#FFFFFF"><div>
      <br>
      Any time, user can choose to disconnect his account from the APP,
      so we developed that when user disconnects their account from the
      APP it calls to unregister, because we don&#39;t want that the APP
      receives more notifications. (Maybe that is our first mistake?)<br></div></div></blockquote><div><br></div><div>remove the cateory</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 text="#000000" bgcolor="#FFFFFF"><div>I don&#39;t know how the UPS protects from another app to use the same
      projectID to register to the service (I&#39;ll dive deeper to be sure
      I&#39;m doing things well), but I can&#39;t imagine another way to
      prevent  that a user with our APP manipulate the calls to UPS with
      other alias or categories, exposing the notifications created from
      other LMS sites. I know that it&#39;s not a critical situation because
      notifications should be not used to send sensitive data, but we
      would like to prevent it in some way. <br></div></div></blockquote><div><br></div><div>not sure what you mean here </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 text="#000000" bgcolor="#FFFFFF"><div>
      <br>
      Thanks,<br>
      <br>
      Alex.<br>
      <br>
      <br>
      <br>
      El 18/05/15 a les 14:47, Erik Jan de Wit ha escrit:<br>
    </div><div><div class="h5">
    <blockquote type="cite">
      <pre>The problem is that you don&#39;t want/need to call unregister in a normal
flow. Unregister is used for instance when a new version of you app
drops support for push notifications.

I don&#39;t get why you are proxy-ing the requests to UPS, because you
cannot have 2 applications receiving the same push notifications. On
iOS the bundle id makes sure of that, and on android there is the
unique project id. So even if a second app would register with UPS it
will not get the push notifications.

On Mon, May 18, 2015 at 2:12 PM, Alex Ballesté
<a href="mailto:alexandre.balleste@udl.cat" target="_blank">&lt;alexandre.balleste@udl.cat&gt;</a> wrote:
</pre>
      <blockquote type="cite">
        <pre>Hi, I&#39;m developing a mobile app for android and ios for our University. It
will use AeroGear Unified Push Server to send notifications to students when
a new announcement is sent in our LMS.

We are developing the app with ionic framework and we are using the register
and unregister process through a custom backend service instead of direct
from device.

We use the cordova plugin and we call registers and unregister JS methods,
but we don&#39;t point to the push server endpoint, but backend server instead.
Once the Backend server gets the requests it creates a new request to Push
server providing variantSecret and variantID; the response received is sent
back to the app.

We would like to use this flow for security reasons. We want to avoid that
the users do their own apps and use those values to register and supply
alias to get users notifications. So backend handles the security (tokens,
deviceids, usernames, ... ) and if everything is ok then proxies then
backend generates a new request fullfilling alias and real authentication
parameters and the received parameters from app. We achieved the registation
and unregistration, but when unregistration process is done if we do a new
re-registration then we got a success response, but then notification didn&#39;t
arrive.

Has anybody did something similar to this approximation? Do you have any
advise or trick that would be useful for us?

Thanks in advance

Alex



--

Alexandre Ballesté Crevillén alexandre.balleste at <a href="http://udl.cat" target="_blank">udl.cat</a>
====================
Universitat de Lleida

Àrea de sistemes d&#39;Informació i Comunicacions

Analista/Programador


University of Lleida

Information and Communication Systems Service


Tlf: <a href="tel:%2B34%20973%20702148" value="+34973702148" target="_blank">+34 973 702148</a>

Fax: <a href="tel:%2B34%20973%20702130" value="+34973702130" target="_blank">+34 973 702130</a>

=====================

Avís legal/Aviso legal/Avertiment legal/Legal notice


_______________________________________________
Aerogear-users mailing list
<a href="mailto:Aerogear-users@lists.jboss.org" target="_blank">Aerogear-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-users</a>

</pre>
      </blockquote>
      <pre></pre>
    </blockquote>
    <br>
    <br>
    <div>-- <br>
      <p>Alexandre Ballesté Crevillén alexandre.balleste at <a href="http://udl.cat" target="_blank">udl.cat</a><br>
        ====================<br>
        Universitat de Lleida<br>
      </p>
      <p>Àrea de sistemes d&#39;Informació i Comunicacions</p>
      <p>Analista/Programador</p>
      <br>
      <p>University of Lleida</p>
      <p>Information and Communication Systems Service</p>
      <br>
      <p>Tlf: <a href="tel:%2B34%20973%20702148" value="+34973702148" target="_blank">+34 973 702148</a></p>
      <p>Fax: <a href="tel:%2B34%20973%20702130" value="+34973702130" target="_blank">+34 973 702130</a></p>
      <p>=====================</p>
      <p>
        <a href="http://www.imatge.udl.cat/avis_legal_lopd.html" target="_blank">Avís
          legal/Aviso legal/Avertiment legal/Legal notice</a>
      </p>
    </div>
  </div></div></div>

<br>_______________________________________________<br>
Aerogear-users mailing list<br>
<a href="mailto:Aerogear-users@lists.jboss.org">Aerogear-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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>