Android push notification for adf mobile: Message is coming blank -
we trying implement push notification adf mobile. followed these 2 below blogs our implementation http://deepakcs.blogspot.in/2013/06/adf-mobile-push-notifications-with.html
and server side have refered information present here http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/
we facing issue while receiving notification message gcm. when send notification our provider application receive notification alert sound , client app name message coming blank or null .
our onmessage() method(this method invoke when push notification arrives in client app follows)
public void onmessage(event event) { //parsing payload json string jsonbeanserializationhelper jsonhelper = new jsonbeanserializationhelper(); try { payloadserviceresponse serviceresponse = (payloadserviceresponse)jsonhelper.fromjson(payloadserviceresponse.class, event.getpayload()); map session = (map)adfmfjavautilities.evaluateelexpression("#{applicationscope}"); string newmsg = serviceresponse.getcustommessage(); session.put("pnewmessage", newmsg); } catch (exception e) { e.printstacktrace(); }
we trying store received message in application scope in order display in our ui page once user tapped notification(when user tapped notification message take him page , needs show notification message) how receiving blank message. notification alert sound , client app name coming whenever send notification provider side.
could 1 suggest on this?
thank you.
i facing same problem working gcm. notification received, messages blank in devices.
i able fix adding lines on notificationcompat.builder
:
.setcontenttitle(appname) .setcontenttext(message)
this final code:
notificationcompat.builder nbuilder; nbuilder = new notificationcompat.builder(context) .setdefaults(notification.default_all) .setsmallicon(smallicon) .setwhen(system.currenttimemillis()) .setautocancel(true) .setcontenttitle(appname) .setcontenttext(message) .setticker(message) .setvibrate(new long[] { 100, 250, 100, 250, 100, 250 }) .setsound(alarmsound) .setpriority(notification.priority_max);
Comments
Post a Comment