Recieving Push Notifications

Oct 16, 2012 at 1:39 AM


When the device receives a push notification i.e a new survey.  Is there a way to automatically call the SurveySynchronizationService.StartSynchronization?

I want to be ale to receive the toast message, update the tile to indicate that a new survey has arrived.  When the user taps the tile, it would take then to the survey list.

Other than using a periodic background task I don't see how this can be done.  I suppose you could pass in SurveySynchronizationServiceClient to the RegistrationServiceClient and handle the HttpNotificationChannelExtension.ObserveShellToastNotificationReceivedEvent.

Appreciate any guidance

Thanks, Craig


Oct 17, 2012 at 5:56 PM

Yes, I would listen to the ShellToastNotificationReceived event and call StartSynchronization. This event is only fired if the app is in the foreground. If the app is in the background, your only option is to use a periodic background task. If you implement a background task, however, you may run into contention issues if the background task tries to update the surveys at the same time you are persisting survey values (taking a survey).