久久久久久久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一区 | 国产成人久久久 | 桃色五月 | 99久久久久久 | 久久专区 | 日韩av在线一区二区三区 | 亚洲91精品 | 先锋资源网站 | 国产欧美精品在线观看 | 欧美中文字幕 | 国产精品欧美一区二区三区不卡 | 午夜精品久久久久久久久久久久久 | 夜夜摸天天操 | 亚洲国产精品成人 | 国产成人精品综合 | 一区二区三区在线看 | 伊人久久综合 | 亚洲精品乱码久久久久久9色 | 欧美视频一区二区三区 | 日韩一区欧美一区 | 亚洲午夜在线 | 国产福利91精品一区二区三区 | 久久免费高清视频 | 欧美在线成人影院 | 国产精品欧美日韩 | 日韩精品一区二区三区老鸭窝 | 国产精品成人一区 | 欧美精品一区二区三区蜜桃视频 | 国产免费一区二区三区网站免费 | 在线观看中文字幕亚洲 | 操久久| 精精国产xxxx视频在线播放 | 在线精品国产 |