Oracle MAF: Push Notifications

person Bijeshfolder_openOtheraccess_time August 13, 2015

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.

2015-08-13 13_45_44-5554_Nexus_5_API_22_x86

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.

2015-08-13 13_47_46-Postman


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>