久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

OneSignal 推送通知 ClickEvent 顯示空值 Windows phone

OneSignal Push Notification ClickEvent show empty values Windows phone 8.1 C#(OneSignal 推送通知 ClickEvent 顯示空值 Windows phone 8.1 C#)
本文介紹了OneSignal 推送通知 ClickEvent 顯示空值 Windows phone 8.1 C#的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在為 Windows Phone 8.1 開發 One Signal Push Notifications.通知工作正常.但是當我點擊通知時,消息顯示空值.當應用程序打開時,則在事件中顯示消息.如何獲取通知文本以保存在我的通知屏幕中?

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?

我的 App.Xaml.cs 函數代碼在這里.

My App.Xaml.cs Function code is here.

啟動事件:

 OneSignal.Init("32cdee4b-7838-4b6c-a024-ae25cecb2234", e);
 OneSignal.Init("32cdee4b-7838-4b6c-a024-ae25cecb2234", e, notificationOpened);

這是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!

推薦答案

這是 Windows Phone 8.1 通知的一個限制,其中消息正文未傳遞到應用程序.問題是傳遞給 OnLaunchedLaunchActivatedEventArgs 不包含此值,因此 OneSignal SDK 無法獲取此值.您可以設置一個斷點或打印出 e.Arguments 以查看它 WP8.1 沒有通過它.

It is a limitation of Windows Phone 8.1 notifications where the message body isn't passed to the app. The issue is that LaunchActivatedEventArgs passed to OnLaunched doesn't contain this so the OneSignal SDK can't get this value. You can set a break point or print out e.Arguments to see that it WP8.1 isn't passing this.

不過,您可以通過將消息添加到附加數據"以及數據參數仍會傳遞給您的應用來解決此問題.

You can work around this however by adding your message to Additional Data as well as data parameters are still passed to your app.

這篇關于OneSignal 推送通知 ClickEvent 顯示空值 Windows phone 8.1 C#的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

LINQ to SQL and Concurrency Issues(LINQ to SQL 和并發問題)
Yield return from a try/catch block(try/catch 塊的收益回報)
Should I call Parameters.Clear when reusing a SqlCommand with a transation?(重用帶有事務的 SqlCommand 時,我應該調用 Parameters.Clear 嗎?)
what does a using statement without variable do when disposing?(處理時不帶變量的 using 語句有什么作用?)
Why doesn#39;t TransactionScope work with Entity Framework?(為什么 TransactionScope 不適用于實體框架?)
How to dispose TransactionScope in cancelable async/await?(如何在可取消的 async/await 中處理 TransactionScope?)
主站蜘蛛池模板: 欧美日韩在线一区二区 | 国产精品日韩 | 一区二区成人 | 日韩精品一区二区三区在线观看 | av网站免费观看 | 日本精品久久 | 草比网站| 看毛片的网站 | 色综合九九 | 少妇精品亚洲一区二区成人 | 国产精品毛片无码 | 久草网站 | 亚洲福利| 免费电影av | 欧美日韩视频网站 | 国产黄色网 | 国产成人免费在线 | 亚洲精品1区2区3区 91免费看片 | 国产精品久久久久久久久久久免费看 | 欧洲精品久久久久毛片完整版 | 成人在线精品 | 中文字幕在线观看视频一区 | 国产精品看片 | 成人h动漫精品一区二区器材 | 九九视频在线观看 | 91精品久久久久久久久久小网站 | 91亚洲精品在线观看 | 久久国产精品一区二区三区 | 日韩三级一区 | 爱爱视频在线观看 | 中文字幕精品一区二区三区精品 | 岛国一区| 日本特黄a级高清免费大片 国产精品久久性 | 久热久| av三级 | 天天爽夜夜操 | 亚洲精品免费观看 | 精品视频一区二区三区在线观看 | 成人毛片一区二区三区 | 国产japanhdxxxx麻豆 | 91精品国产乱码久久蜜臀 |