简体   繁体   中英

WP7 push notifications received in application

I'm wondering if it's possible to receive toast push-notifications (or any push-notification for that matter) on wp7 in my code when the notification was sent when my application was closed. For example. Right now I have a demo-application that increments a number every time I send a toast-notification to the application. While the application is running, this works perfectly, but if I close the app and send a toast-notification the notification-line on top shows (as it should), and when I click it the number doesn't get updated. In other words, I would like my channel.ShellToastNotificationReceived to be run after I've received notifications, when the application is once again opened, and I'm wondering if this is possible?

As an alternative, is this is not doable, is it possible to get a small piece of code to run whenever I receive a toast notification? Like, create a background agent or something like that that gets called whenever my application receives a toast (or raw, or any other type for that matter) of push-notification?

There is no way to start your app remotely without any user action.

But in your case you can easily compensate for that: let the app ask for data. The app just has to ask the server for the most recent value when starting up. Then it can act as if it received the push notifications.

How about you just make a storage server like you said you didn't want to. It wouldn't take much memrory at all and would be a quick poll.

Just have the server increment everytime a notication is receieved and send the accumulative number to the app with a WCF service. It'll take you like 10 minutes to write.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM