How can I format the push notification so that when it displays on the status bar it can take advantage of the local notification’s construct – show the text and hide the data?
Behavior: Push notifications display on the device's status bar when the mobile app is not running. When the user clicks on the notification on the status bar, the notification disappears and the app opens. Though this is acceptable behavior, the originating push notification was not formatted for the user to view on the status bar. How can the push notification be formatted so that it is more compatible with status bar (local notification) viewing? In other words, hide the data but show user readable text?
Plugins:
- Push Notification: phonegap-plugin-push Local Notification
- Local Notification: de.appplant.cordova.plugin.local-notification
.Net C# App Service code:
string xml = "<ACTION>Add</ACTION>" +
"<UserId>" + ut.UserId + " </UserId>";
Dictionary<string, string> templateParams = new Dictionary<string, string>();
templateParams["messageParam"] = xml;
try
{
NotificationOutcome result = await
hub.SendTemplateNotificationAsync(templateParams, tagId);
config.Services.GetTraceWriter().Info(result.State.ToString());
return result;
}
Below is my Mobile App code:
cordova.plugins.notification.local.on("click", function (notification) {
// Notification.text - contains whatever is in messageParam
// Notification.data - How do I format the app service code so that the
// xml shows up in Notification.data?
});
Thanks for any help.