locked
Why are toast notification not displays sometimes? RRS feed

  • Question

  • I debug the code and no errors are reported. Yet the toast does not show up inside the app.
    Thursday, September 27, 2012 10:19 PM

All replies

  • Take a look at the troubleshooting suggestions in Guidelines and checklist for toast notifications, and if you still need help please provide more information about the problem: what exactly is your code doing? what does the XML look like? is this a problem on just one machine or on several? do toasts from other apps work? etc.

    Thursday, September 27, 2012 11:56 PM
    Moderator
  • This is the code:

    ToastNotificationManager = Notifications.ToastNotificationManager;
    
      toast = function(options) {
        var i, textElements, texts, xml, _i, _ref;
        options.template || (options.template = "toastText01");
        xml = ToastNotificationManager.getTemplateContent(ToastTemplateType[options.template]);
        if (!Array.isArray(options.text)) {
          texts = [options.text];
        }
        textElements = xml.getElementsByTagName("text");
        for (i = _i = 0, _ref = Math.min(texts.length, textElements.length) - 1; _i <= _ref; i = _i += 1) {
          textElements[i].appendChild(xml.createTextNode(texts[i]));
        }
        toast = new ToastNotification(xml);
        toast.onactivated = options.onactivated;
        return ToastNotificationManager.createToastNotifier().show(toast);

    And the XML looks valid.

    <toast><visual><binding template="ToastText01"><text id="1">One document trashed.</text></binding></visual></toast>

    Notifications are enabled system wide and other apps show notifications.

    • Marked as answer by Dino He Thursday, October 11, 2012 2:29 PM
    • Unmarked as answer by Dino He Thursday, October 11, 2012 2:30 PM
    Friday, September 28, 2012 8:42 AM