title: Adding alarm from BackgroundAgent (not working, looking for workarounds) - Windows Phone 8
body: <p>I am developing an application which needs to notify the user at a pre-difined time with the help of background agent,
  So I tried to add an Alarm, but according to MSDN's  "<a href="http://msdn.microsoft.com/en-us/library/hh202962%28v=VS.92%29.aspx" rel="nofollow">Unsupported APIs for Background Agents for Windows Phone</a>" all the methods regarding <a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.scheduler%28v=vs.105%29.aspx" rel="nofollow">Microsoft.Phone.Scheduler</a> (Add, Remove, Replace) are not supported (when ever i try to call Add method from background agent it gives error "BNS Error: The API can only be called from foreground app".). I tried to add the alarm when in foreground and then play with the "BeginTime" property and use the Replace method from the my scheduledTask (specifically, PeriodicTask which runs its code every 30 minutes) but to no avail, it did nothing.</p>
  
  <p>What is important for me is to notify the user (with longer-enough sound) at the date and time that decided in the background-agent's Invoke method (My class derives from <a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.scheduler.scheduledtaskagent%28v=vs.105%29.aspx" rel="nofollow">ScheduledTaskAgent</a>  and override the Invoke method), So I'm looking for workarounds. If there would be a toast that appears at a pre-defined time that would be ok somehow.  Or maybe a toast that stays for a longer time on the top of the screen (from the moment the scheduled-task came up with an instance of DateTime until[and even after] the time that specifiend in this DateTime instance).</p>