0

I am creating an WebView app i.e it contains only WebBrowser control which opens some enterprise mobile web app. I am using Urban Airship for push notifications.

Now I want to show the pending tile/toast notification count as badge on tile as well as on lock screen. How do I perform that? Is there any event which occurs when notification is pushed, if yes how can I use to maintain the count? Can I use background task? I am thinking to clear the badge when app is launched.

I am totally new in push notifications for Windows Phone. I searched a lot but didn't get expected results.

Get tile notifications count Windows phone

Count unreaded Number of missed call and message in windows phone

Community
  • 1
  • 1
Farhan Ghumra
  • 15,180
  • 6
  • 50
  • 115
  • Do you have the access to the pending notifications count? – crea7or Jan 18 '14 at 12:41
  • No, Urban Airship just offers a panel to send the push messages. What if I have access to it? – Farhan Ghumra Jan 18 '14 at 14:41
  • Maybe I didn't understand correctly.. What do you want to display? Received notifications count that is not processed by the app? – crea7or Jan 19 '14 at 02:40
  • Suppose I am the new user of the app, I used the app for 15 mins, then I quit the app. Then I can toast notifcation 1,2,3...10 i.e. I got 10 notifications. So the badge should show 10 on lockscreen as well as on tile.When I reopen the app 10 would be cleared. Then I quit notification comes 1,2...5 so badge would be 5. – Farhan Ghumra Jan 19 '14 at 03:51

1 Answers1

0

Here is a good sample of tile notification in msdn. You don't even need a background agent for this task, it will be done by the system. There is also a toast notification sample.

crea7or
  • 4,421
  • 2
  • 26
  • 37
  • I checked the link, it doesn't mention that the badge will be auto-incremented as soon as toast notification is received. I need to manually send the badge value from server side. – Farhan Ghumra Jan 22 '14 at 04:53
  • Create background agent that will manage the value by connection the server. Create some file in the isolates storage with last read timestamp and reset it in the application (also update the tile from the app). So, background agent will be able to check this file at the next run and reset the count too. – crea7or Jan 22 '14 at 06:24
  • Push is generated from Urban Airship manually, I don't have access to it programmatically. So background agent can't connect to it. – Farhan Ghumra Jan 22 '14 at 06:29
  • It's not possible to get this value from Push notification service in the background agent because [this API is banned](http://stackoverflow.com/questions/16670677/push-notification-inside-scheduledagent-in-windows-phone-8). So, I see no other way to do that. Maybe others can help. – crea7or Jan 22 '14 at 06:48