I'm working on One Signal Push Notifications for windows phone 8.1. Notification works fine. but when I click on notification then the message display empty value. While when application is ON then message display in event. how can I get the notification text to save in my notification screen?
My App.Xaml.cs Function code is here.
OnLaunched Event:
OneSignal.Init("32cdee4b-7838-4b6c-a024-ae25cecb2234", e);
OneSignal.Init("32cdee4b-7838-4b6c-a024-ae25cecb2234", e, notificationOpened);
Here is notificationOpened Function Code:
private async void notificationOpened(string message, IDictionary<string, string> additionalData, bool isActive)
{
if (message != null && message != "")
{
DatabaseHelperClass Db_Helper = new DatabaseHelperClass();//Creating object for DatabaseHelperClass.cs from ViewModel/DatabaseHelperClass.cs
try
{
Db_Helper.Insert(new MessagesClass(message));
}
catch
{
MessageDialog messageDialog = new MessageDialog("There is an error while saving this details. Please try again later!");//Text should not be empty
await messageDialog.ShowAsync();
}
}
else
{
//Here I have check for empty value
settingsClass.SaveSetting("NotiClick", "MoveToMeldingen");
}
When application is on active state then I gets the message but when application is in background and notification receives in notification tray then y clicking on this I gets empty message string. Please help me to get rid of this issue. Thank you!