locked
Windows 8.1 Alarm and command actions

    Question

  • Hi everybody,

    I'm working on an Alarm Clock for Windows 8.1 as a Windows Store App. I have already managed to get ScheduledNotifications and everything works flawlessly.

    My issue comes when the user touches one of the preset commands (Snooze or Dismiss) in the Alarm notification: is there a way to be called when one of these actions is triggered?

    I need to know when the user has snoozed or dismissed an alarm, just to schedule the next alarm. In other words: the user has set the alarm to repeat itself every Tuesday at 8.00AM. The first alarm has been scheduled when my application was opened, but how can I schedule the alarm for the next Tuesday (and all the Tuesdays in the future)?

    One way I found is to schedule all the alarms for a long period (like a month), hoping that the user will open my application at least once in that period (so I can schedule other alarms), but it looks like a waste of system resources.

    Thank you in advance!

    Sunday, August 10, 2014 9:50 AM

Answers

  • Hi InerziaSoft,

    You are correct, schedule the alarms for a long period is not suggested, but schedule for a short period is necessary. I would like suggest you to register the notification for a short period and re-register some once the previous are completed.

    Take a look at the documentation: How to handle activation from a toast notification. Seems we can only handle the activation from notification but cannot trigger a click or dismiss event, those events are handled by System.

    Here are some best practice for you to handle a notification: Toast notifications

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by InerziaSoft Thursday, August 14, 2014 10:45 AM
    Monday, August 11, 2014 2:46 AM
    Moderator

All replies

  • Hi InerziaSoft,

    You are correct, schedule the alarms for a long period is not suggested, but schedule for a short period is necessary. I would like suggest you to register the notification for a short period and re-register some once the previous are completed.

    Take a look at the documentation: How to handle activation from a toast notification. Seems we can only handle the activation from notification but cannot trigger a click or dismiss event, those events are handled by System.

    Here are some best practice for you to handle a notification: Toast notifications

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by InerziaSoft Thursday, August 14, 2014 10:45 AM
    Monday, August 11, 2014 2:46 AM
    Moderator
  • Hi Jamles,

    Thank you very much for your help. Hoping that could help, I bought this book: http://www.amazon.com/Windows-8-1-Apps-XAML-Unleashed/dp/0672337088

    In the section that talks about special toast notifications in Windows 8.1, the author clearly states that a command tag supports an arguments attribute: "The optional arguments are used to tell your app which button (if any) was clicked when your app gets the launch activation."

    But, as you pointed in your message, these buttons are handled by the system. So, my question become, clearly: why Microsoft prevented us (and itself, because the Windows Alarm has the same issue) from handling this kind of events?

    Anyway, thank you again.

    Thursday, August 14, 2014 10:45 AM