久久久久久久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?)
主站蜘蛛池模板: 在线免费看a | 日本免费视频 | 91午夜精品亚洲一区二区三区 | 成人羞羞国产免费 | www国产精品 | 国产精品一品二区三区的使用体验 | 视频爱爱免费视频爱爱太爽 | 免费不卡视频 | 四虎影视库 | 毛片网站免费观看 | 免费观看a级片 | 国产视频一 | 国产a级大片 | www.99riav| 97久久精品人人澡人人爽 | 深夜福利免费 | 欧美日韩视频 | 日韩精品一区二区视频 | 亚洲免费精品视频 | 另类小说第一草 | 国产日韩精品在线 | 中文字幕亚洲一区 | 免费看黄色大片 | 免费福利片 | 日韩成人免费 | 22精品一区二区三区 | 日日干视频 | av黄色在线观看 | 五月天在线观看 | 色婷婷影视 | 亚洲激情视频在线观看 | 户外少妇对白啪啪野战 | 中文字幕婷婷 | 四虎com| 中文字幕在线一区二区三区 | 九九视频免费观看 | 欧美综合久久 | 国产乱码精品一品二品 | 久久久一本 | 日韩国产精品视频 | 欧美日韩一区二 |