For AGPUSH-969 and to kick off the discussions, I started a small POC
mainly focused on the backend. To sum up quickly : we want to know how many
installations/users has opened the application after that a Push
Notification has been touched.
So, the very first thing that had to be done was to give the Push
Notification a unique identifier, so that we can track it and do the
metrics on it.
For that, I have been using an existing model object that we have , the
PushMessageInformation, and that is currently used to provide
information for our dashboard.
This object has now some extra fields, like a appOpenCounter etc ...
The ID of this PushMessageInformation is now passed into the payload of the
Push Message, just before we send it, this way the client library can use
this ID to pass extra information to the UPS when a notification is
For this POC, I hijacked the cordova-helloworld, so that it extracts the ID
from the payload and pass it as header when registering.
When the UPS receive the request, it looks for the header and if it exist
it updates the existing PushMessageInformation instance.
Please note, that for this POC, all is happening on Application level and
not on Variant level but that can be easily changed. It depends on how
fined grained we want to have these analytics.
I did a small screencast that shows this in action :
The UPS branch containing the changes is here (the 2 latests commits are
The client app is not really relevant since I really hacked badly the app
(and the push plugin) ;) , however if interested I may share it.
Now, let's discuss :)
I was trying (and so was Lukas) to deploy UPS 1.1 (master branch) to an
openshift gear (Wildfly 8.2 cartridge). After tweaking a bit the
datasources to get it deployed, when trying to access /ag-push , I'm get an
500 internal server error.
The wildfly logs show me the following :
2015-03-31 09:40:47,240 ERROR [io.undertow.request] (default task-8)
UT005023: Exception handling request to /ag-push/index.html:
java.lang.RuntimeException: Unable to resolve realm public key
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_31]
Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
So "peer not authenticated" seems pretty obvious for the reason it fails.
The question is what do we need to do for this ? Anyone an idea ?
I think few days ago there was some information from Karel Piwko that we
developed fully automatic functional tests when it comes to Cordova
quickstarts (1) (hello world and shoot and share)
We think that it could be useful for developers as well. This tests the
whole life cycle of the push from creation of UPS cartridge through
building of the example to the functional test in a fully automatic manner
from zero setup to push notification receive at mobile device you have
connected to your notebook and it could be useful for developers in order
to not execute it manually every time and set it up all over again.
By what I mean "fully automatic" is the following scenario:
1) Automatic creation of UPS cartridge on OpenShift right from our test,
patched with this extension * (2), (3)
2) Because of the deployed extension to UPS in 1), we can login via REST
and we do not need to change passwords so we can create application with
some variant directly from our test script (4)
3) After this is done, quickstart example is downloaded from GH, Android
SDK is installed locally at your PC, quickstart is filled with application
and google credentials automatically and after that it is built
4) APK built in 3) is then used in functional test by Arquillian Droidium
(5) which deploys that APK to physical device and in that test, we send
push notification request to UPS
5) Once push notification comes to UPS, it sends it to GCM which in turn
sends it to physical device and Droidium test asserts that the message
really came and appeared on the mobile device.
It takes about 10 minutes, you have to have Android device attached to your
PC since test will communicate with it. Time could be massively decreased
when you do not expect new OS UPS instance to be created every time.
You execute it like this in
./gradlew test -Pprofile=helloWorldCordovaQuickstart \
-PgoogleProjectNumber=<your project number> \
-PgoogleKey=<your google key> \
-PopenShiftUsername=<email of your openshift account>
-PopenShiftPassword=<password for your openshift account> \
Similar process is executed with Shoot & Share demo where we send image to
Facebook. All triggered by one shell command from integration tests and
after that the above magic happens.
I case you want to use it and you struggle with it, feel free to ask me for
* unified-test-extension adds custom functionality to UPS cartridge, it
adds fancy performance test endpoints where you can feed UPS instance with
custom number of generated installations / categories / variants and so on.
More to it, it can put proxy behind sender API so push notifications goes
nowhere in the end but it seems like they were indeed sent from UPS point
of view. This is particularly handy in test environment where you really do
not want to send anything to APNS or GCM.
Red Hat Brno - JBoss Mobile Platform
I participated in GSoC 2014 with Twitter and worked on Netty last year.
Unfortunately, this year Google does not accept Twitter as a mentoring
organization. So I'm trying to find a new organization and a new project
for this summer.
I know that time for student applications is over, but I have one opened
proposal for JBoss Community. I found WebPush Server at the last day of
student applications' deadline. I'm really interested in it and I want to
change my proposal and work on WebPush Server!
WebPush Server is a new project which should have many tasks and plan to
use new features of Netty 5 (HTTP/2) and Java 8. All of these are very
interesting for me. Also I have 2 years experience of server-side
development of other services (mobile API, administrative panels, etc.) on
Jetty, WildFly and JBoss AS7. So I will be able to work on any part of
WebPush Server and not only on server-netty subproject.
I began to get acquainted with the WebPush Server code base, WebPush
Protocol and Push API last weekend. Also I I've used AeroGear UnifiedPush
Server in one of my projects on my work. And it's perfect! AeroGear is easy
to configure and push notifications. Thanks to all for this work!
Could you, please, help me to find a project idea for my new proposal
for WebPush Server?
GitHub: @idelpivnitskiy <https://github.com/idelpivnitskiy>