<div dir="ltr"><div>Just to be clear, we are talking about metrics for messages delivered (received on device) or about really read/open?<br><br>Because in Android land is not possible know when message was read/opened. We delegate how the message will be delivered/showed to the MessageHandler[1] and we don't have access to it.<br><br>Today we only have access when the message is delivered. Basically we receive the message in a AeroGearGCMMessageReceiver[2] do some checks and push the message for all Handles registered[3][4]<br><br>[1] <a href="https://github.com/aerogear/aerogear-android-push/blob/master/aerogear-android-push/src/main/java/org/jboss/aerogear/android/unifiedpush/MessageHandler.java">https://github.com/aerogear/aerogear-android-push/blob/master/aerogear-android-push/src/main/java/org/jboss/aerogear/android/unifiedpush/MessageHandler.java</a><br>[2]
<a href="https://github.com/aerogear/aerogear-android-push/blob/master/aerogear-android-push/src/main/java/org/jboss/aerogear/android/unifiedpush/gcm/AeroGearGCMMessageReceiver.java">https://github.com/aerogear/aerogear-android-push/blob/master/aerogear-android-push/src/main/java/org/jboss/aerogear/android/unifiedpush/gcm/AeroGearGCMMessageReceiver.java</a><br>[3] <a href="https://github.com/aerogear/aerogear-android-push/blob/master/aerogear-android-push/src/main/java/org/jboss/aerogear/android/unifiedpush/RegistrarManager.java#L118">https://github.com/aerogear/aerogear-android-push/blob/master/aerogear-android-push/src/main/java/org/jboss/aerogear/android/unifiedpush/RegistrarManager.java#L118</a><br>[4] <a href="https://github.com/aerogear/aerogear-android-push/blob/master/aerogear-android-push/src/main/java/org/jboss/aerogear/android/unifiedpush/RegistrarManager.java#L130">https://github.com/aerogear/aerogear-android-push/blob/master/aerogear-android-push/src/main/java/org/jboss/aerogear/android/unifiedpush/RegistrarManager.java#L130</a><br><br></div>-- Passos<br><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 6, 2015 at 6:38 AM, Matthias Wessendorf <span dir="ltr"><<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br></div><div><br></div><div>as discussed on the previous thread, there will be a new endpoint to 'track' the "App opened/launched due to received push notification".</div><div><br></div><div>Internally, on the UPS, the Push Message has an ID, which get's append to the payload of the notification, like here:</div><div><a href="https://github.com/matzew/aerogear-unifiedpush-server/blob/analytics/push/sender/src/main/java/org/jboss/aerogear/unifiedpush/message/sender/APNsPushNotificationSender.java#L107-L108" target="_blank">https://github.com/matzew/aerogear-unifiedpush-server/blob/analytics/push/sender/src/main/java/org/jboss/aerogear/unifiedpush/message/sender/APNsPushNotificationSender.java#L107-L108</a></div><div><br></div><div>On the client SDKs this will be read and a HTTP call made to the soon introduced MetricsEndpoint. Currently this info is send to the RegistrationEndpoint, including the deviceToken/registrationId. However, I think that the deviceToken/registrationId is currently not needed for metrics, since we are just interested in anonymous "app launched/opened due to push", and not a specific "DEVICE X did open, while DEVICE Y did not yet open".</div><div><br></div><div>So all we really need is the ID of the push notification, to be processed by our Metrics Service</div><div><a href="https://github.com/matzew/aerogear-unifiedpush-server/blob/analytics/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/installations/InstallationRegistrationEndpoint.java#L128-L133" target="_blank">https://github.com/matzew/aerogear-unifiedpush-server/blob/analytics/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/installations/InstallationRegistrationEndpoint.java#L128-L133</a></div><div><br></div><div>Therefore my proposal is have an endpoint:</div><div><br></div><div>PUT /metrics/pushmessage/{pushMessageID}</div><div><br></div><div>I think PUT is good/best, because there is nothing really created on the server, it's more updating the 'counter' on the existing PushMessageInformation object.</div><div><br></div><div>Thoughts?</div><div>-Matthias</div></div></blockquote></div></div></div>