Answered by:
Why Do I Receive Three Notifications for a Single ToDo Entry

Question
-
Hi,
In a front-end created from the Get started with push notifications and Push notifications to users by using Mobile Services tutorials, entering a single ToDo Item results in three notification messages, as shown in section 7 of my Windows Azure Mobile Services Preview Walkthrough–Part 3: Pushing Notifications to Windows 8 Users (C#) article.
It isn't clear what steps I should take to eliminate the extra notifications.
Thanks in advance for any ideas on the subject.
Cheers,
--rj
Microsoft Access 2010 In Depth (QUE Publishing)
OakLeaf Blog
Access 2010 Blog
Amazon Author BlogThursday, September 20, 2012 6:13 PM
Answers
-
Hi Roger,
It is technically possible to receive multiple active (different) channelUrls for the same installed app on the same device. I'd recommend taking a look at our push implementation in the doto client sample which stores an 'installation id' in the channel table to ensure we only have one channel url per actual device installation.
The doto sample is available here: http://code.msdn.microsoft.com/windowsapps/doto-a-simple-social-todo-7e6ba464
Josh
http://twitter.com/joshtwist
- Edited by Josh Twist (MSFT) Saturday, September 22, 2012 4:43 PM
- Marked as answer by Roger Jennings Tuesday, September 25, 2012 12:08 AM
Friday, September 21, 2012 10:49 PM
All replies
-
Hi Roger,
In your post you observe that you might have ended up with duplicates in the channel table. Are you saying that after removing the duplicates, you are still receiving multiple notifications?
Paul
Thursday, September 20, 2012 8:22 PM -
Hi, Paul,
Went back, checked the table and found no duplicates. Reran the app from the Start menu and received a set of three notifications followed by a single notification. Reopened the Channel table in SQL Server Object explorer and found no duplicates.
This strange behavior might prevent my app from re-registering in the Windows Store.
Cheers,
--rj
Microsoft Access 2010 In Depth (QUE Publishing)
OakLeaf Blog
Access 2010 Blog
Amazon Author BlogThursday, September 20, 2012 9:16 PM -
Very interesting! I can see that your script also logs the push response. How many new entries showing a successful push appear in your log when you insert a single item?Friday, September 21, 2012 7:53 PM
-
Hi Roger,
It is technically possible to receive multiple active (different) channelUrls for the same installed app on the same device. I'd recommend taking a look at our push implementation in the doto client sample which stores an 'installation id' in the channel table to ensure we only have one channel url per actual device installation.
The doto sample is available here: http://code.msdn.microsoft.com/windowsapps/doto-a-simple-social-todo-7e6ba464
Josh
http://twitter.com/joshtwist
- Edited by Josh Twist (MSFT) Saturday, September 22, 2012 4:43 PM
- Marked as answer by Roger Jennings Tuesday, September 25, 2012 12:08 AM
Friday, September 21, 2012 10:49 PM -
Hi, Paul,
I get 7 success log entries and a bunch of errors for a single todo item with the previous contents of the ToDoItem and Channel tables.
After deleting all rows of both tables, I get the expected single notification. Will update blog post and check/apply Josh's code tomorrow AM.
Thanks for your help, as well as Josh's,
--rj
Microsoft Access 2010 In Depth (QUE Publishing)
OakLeaf Blog
Access 2010 Blog
Amazon Author BlogSaturday, September 22, 2012 12:00 AM -
Forgot to include the multiple-exposure screen capture for the blog post:
Microsoft Access 2010 In Depth (QUE Publishing)
OakLeaf Blog
Access 2010 Blog
Amazon Author BlogSaturday, September 22, 2012 12:03 AM -
I can't see the image clearly above but I suspect your app has multiple active channels for the device (you sent three notifications to three different channel urls, but they all point to your device). Take a look at the RegisterDevice method from the doto sample: https://github.com/WindowsAzure/azure-mobile-services/blob/master/samples/doto/C%23/ViewModels/MainViewModel.cs which uses the InstallationId type: https://github.com/WindowsAzure/azure-mobile-services/blob/master/samples/doto/C%23/Common/InstallationId.cs.
Then check the script we have on insert: https://github.com/WindowsAzure/azure-mobile-services/blob/master/samples/doto/ServerScripts/devices.insert.js
Hope that helps, let me know if you have any more questions.
http://twitter.com/joshtwist
- Edited by Josh Twist (MSFT) Saturday, September 22, 2012 4:43 PM
Saturday, September 22, 2012 4:42 PM