<div dir="ltr"><p style="margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px;margin-top:0px!important">Hi Folks !</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">During our last f2f we agreed on adding some geolocation support for the next UnifiedPush Release (1.1). I would like to start here a thread to discuss this topic.</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">Let&#39;s keep in mind : <em>Crawl, Walk, Run</em></p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">I would like to start with a concrete proposition and initiate the discussions from there :</p><h1 style="font-size:2.25em;margin:1em 0px 16px;line-height:1.2;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif"><a name="user-content-installations" class="" href="https://gist.github.com/sebastienblanc/d89e41b72c9de537dbde#installations" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-right:6px;padding-left:30px"></a>Installations</h1><h2 style="margin-top:1em;margin-bottom:16px;line-height:1.225;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif"><a name="user-content-model-change" class="" href="https://gist.github.com/sebastienblanc/d89e41b72c9de537dbde#model-change" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-right:6px;padding-left:30px"></a>Model Change</h2><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">The idea is to add 2 new fields to the <code style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:rgba(0,0,0,0.0392157)">Installation</code> Object :</p><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:14px;margin-top:0px;margin-bottom:16px;padding:16px;overflow:auto;line-height:1.45;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);background-color:rgb(247,247,247)"><code style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:14px;padding:0px;margin:0px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;border:0px;display:inline;line-height:inherit;word-wrap:normal;background:transparent">double longitude;
double latitude;

</code></pre><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">These field <strong>should</strong> be optional !</p><h2 style="margin-top:1em;margin-bottom:16px;line-height:1.225;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif"><a name="user-content-registration" class="" href="https://gist.github.com/sebastienblanc/d89e41b72c9de537dbde#registration" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-right:6px;padding-left:30px"></a>Registration</h2><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">When the device registers, along with alias, categories etc ... it will also be possible to pass a latitude and longitude.</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">Later, we will probably offer a endpoint to update these properties. <code style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:rgba(0,0,0,0.0392157)">PUT /registry/device/{token}</code></p><h1 style="font-size:2.25em;margin:1em 0px 16px;line-height:1.2;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif"><a name="user-content-sender" class="" href="https://gist.github.com/sebastienblanc/d89e41b72c9de537dbde#sender" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-right:6px;padding-left:30px"></a>Sender</h1><h2 style="margin-top:1em;margin-bottom:16px;line-height:1.225;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif"><a name="user-content-server-side" class="" href="https://gist.github.com/sebastienblanc/d89e41b72c9de537dbde#server-side" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-right:6px;padding-left:30px"></a>Server Side</h2><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">We need to extend the current sender API to be able to add geolocation as a criteria. I see that as something like :</p><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:14px;margin-top:0px;margin-bottom:16px;padding:16px;overflow:auto;line-height:1.45;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);background-color:rgb(247,247,247)"><code style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:14px;padding:0px;margin:0px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;border:0px;display:inline;line-height:inherit;word-wrap:normal;background:transparent">{
  &quot;message&quot;:{
    &quot;alert&quot;:&quot;HELLO!
  },
  &quot;criteria&quot;:{
   &quot;geolocation&quot;:
       {
      &quot;latitude&quot; : 40.2566
      &quot;longitude&quot;: 2.36556
      &quot;within&quot; : 5 
      &quot;unit&quot; : &quot;Km&quot; // optional, default is Km  
       }
  }
}

</code></pre><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">In this example, the Push Notification will be sent only to devices within a radius of 5 km of the supplied location.</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">On the implementation side, I think it make sense to use Hibernate Search since it has nice support for<a href="https://docs.jboss.org/hibernate/search/4.2/reference/en-US/html/spatial.html" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none">Spatial queries</a>.</p><h2 style="margin-top:1em;margin-bottom:16px;line-height:1.225;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif"><a name="user-content-sender-client" class="" href="https://gist.github.com/sebastienblanc/d89e41b72c9de537dbde#sender-client" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-right:6px;padding-left:30px"></a>Sender Client</h2><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">The different Sender Clients (Java, Node.js, .net) should be updated accordingly.</p><h1 style="font-size:2.25em;margin:1em 0px 16px;line-height:1.2;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif"><a name="user-content-client-sdks" class="" href="https://gist.github.com/sebastienblanc/d89e41b72c9de537dbde#client-sdks" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none;display:block;padding-right:6px;padding-left:30px"></a>Client SDKs</h1><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">In this fisrt iteration, the registration code would to be updated to include latitude and longitude for :</p><ul class="" style="padding:0px 0px 0px 2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px"><li>iOS (Including Safari ? )</li><li>Android ( Including Chrome Apps ?)</li><li>JS UPS-SPS Lib</li><li>Cordova Plugin</li><li>Amazon</li><li>Windows</li></ul><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">Retrieving the current position of the device is not in scope of this first version, later we could offer some features around that.</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">There are some jiras to track these tasks : <a href="https://issues.jboss.org/browse/AGPUSH-828" rel="noreferrer" style="color:rgb(65,131,196);text-decoration:none">https://issues.jboss.org/browse/AGPUSH-828</a></p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">Comments and questions welcome !</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif;font-size:16px;line-height:25.6000003814697px">Sebi</p></div>