Wading through the JavaEE ocean!!

Some gotchas with how push notifications work in Oracle MAF and Android.

1) The payload must be a “data” payload and contain an “alert” element with text. This appears to be the only way to have text display in the Android notification. Else, you just get a blank notification with the App name but no text. I also think that MAF expects to find a “msgcnt” element for the count – I can’t substantiate this claim though. This is as implemented by oracle.adfmf.framework.pushnotification.AdfmfGCMIntentService.

2) The GCM SenderId should be the project number and not the project id. There appears to be conflicting info on this with some posts suggesting use of Project Id. But no, for GCM, this should be the Project Number. This is also the number displayed in the Developer Console URL when exploring the project.

Testing notification receipt. The simplest way to test receiving push messages is to use something like POSTMAN to send a REST request to GCM. This does require that you obtain the device registration token after running the app – perhaps from the logs.