locked
Facing issue with toast notification

    Question

  • I want to send toast notification through WNS.

    When a record is inserted in the database, my service will send a toast notification through WNS. When I send a toast notification which contains only text. it appears properly. But when I try to send a toast notification with image and text then only text appears. I tried sending different format but its not working, please help.

    string toastTemplate = "ToastImageAndText01";
                string toast = string.Format("<toast><visual>" +
                                            "<binding template=\"{0}\">" +
                                            "<image id=\"1\" src=\"{1}\" alt=\"image1\"/>" +
                                            "<text id=\"1\">{2}</text>" +
                                            "</binding>", toastTemplate, "http://localhost:13180/images/sample.png", Title);
                toast += "</visual></toast>";
     

    Chetan

    Thursday, August 23, 2012 1:00 PM

Answers

  • the issue got resolved.. the image size was big so the notification was getting discarded.

    image size needs to be less than 200 kb and 1024*1024 pixels.


    Chetan

    Thursday, August 23, 2012 1:49 PM

All replies

  • Hi Chetan,

    You cannot access localhost from your application so this will not work.  Try an URI to a public webserver instead and that should resolve.

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, August 23, 2012 1:16 PM
    Moderator
  • the issue got resolved.. the image size was big so the notification was getting discarded.

    image size needs to be less than 200 kb and 1024*1024 pixels.


    Chetan

    Thursday, August 23, 2012 1:49 PM
  • I was not accessing the localhost from a windows 8 app but from a web service.

    Chetan

    Tuesday, August 28, 2012 4:22 AM
  • I hosted the service on cloud. I get a toast notification when a new record is inserted but the image is not displayed in the toast notification. what can be the issue?

     string toastTemplate = "ToastImageAndText01";
                string toast = string.Format("<toast><visual>" +
                                            "<binding template=\"{0}\">" +
                                            "<image id=\"1\" src=\"{1}\" alt=\"image1\"/>" +
                                            "<text id=\"1\">{2}</text>" +
                                            "</binding>", toastTemplate, "http://*******************.cloudapp.net/images/"+ "sample.jpg", "test");
                toast += "</visual></toast>";
    


    Chetan

    Wednesday, August 29, 2012 7:01 AM
  • The issue is that there is some problem with the image itself.  Either it could not be fetched or there is a problem with the format of the image.

    Jeff Sanders (MSFT)

    Wednesday, August 29, 2012 11:37 AM
    Moderator