Asked by:
Limit Toast Notifications to 1 at any given time.

General discussion
-
I have tried using the:
var scheduled = toastNotifier.getScheduledToastNotifications();
to do this, but I still sometimes get 2 or 3 at the same time when one would be enough for the application.
- Changed type ViralBeeb Tuesday, April 16, 2013 5:53 PM
Monday, April 8, 2013 9:36 PM
All replies
-
Hi T,
I don't understand.
If you only want one Toast Notification only send one.
-Jeff
Jeff Sanders (MSFT)
Tuesday, April 9, 2013 1:45 PMModerator -
Haha, sorry, I was clearly confused. I was actually having issues with toasting on a background task. I gave up in the end, I think I will just skip background tasks altogether until there is a decent tutorial for JS. It is way too complicated for my tiny brain.
Thanks for the reply though Jeff.
Wednesday, April 10, 2013 12:10 AM -
Hi T,
What do you want to do in your app? How are you using the Toast from your background worker? Perhaps I can point you in the right direction!
-Jeff
Jeff Sanders (MSFT)
Wednesday, April 10, 2013 12:06 PMModerator -
Thanks Jeff,
I have been following Jeff Brand's tutorials for the Twitter reader. He doesn't cover toast or background though (sad face). I got the toast working using the "created_at" data, so it just checks whether the currently loaded tweet was posted in the last minute, if it was it toasts it.
I wanted to allow this to continue to happen in the background. So in theory you can read twitter updates for whatever specific search you last left the app on without refreshing. But because the background process can only update once every 15 minutes, I just wanted it show the latest tweet rather than 100s at once.
I was going to put some work in to it so if there had been a lot of tweets it would pick out the most re-tweeted and toast that ignoring the others.
Wednesday, April 10, 2013 12:55 PM -
Hi T,
What you really need is a webservice that will push notifications out rather than try and do this on the client machine. Background services are not designed to do what you are attempting. This has the added benefit that your machine will not have to run your application to continually get tile/toast updates. (PS I would stick with tile updates cause I can imagine the toasts getting REALLY annoying and I would just turn them off).
Flow would be -
Post to your webservice with the channel URL for push notifications and data like what the twitter search should be.
Your webservice would periodically query for changes and use PUSH to broadcast to that users device(s) that has apps installed (you have channel uri for).
-Jeff
Jeff Sanders (MSFT)
Tuesday, April 16, 2013 6:07 PMModerator