I have tried googling for this and came up empty. What I want is a tutorial or example code of how to change my icon on the windows phone like the people application or SMS. For example when you get a new SMS message it puts a number next to the face in the icon. Is there any way for me to do that in my app?
You need to send a Tile Push Notification.
This allows you to update the image, text and (optionally) a number.
Push notifications shoudl be triggered from a remote [web] service.
You can also have the tile update periodically using a ShellTileSchedule.
You can update your application's Tile using Push Notifications from a web service registered with a Microsoft Push Notification Service. However, this isn't absolutely necessary. You can even update your tiles without push notifications, by setting a ShellTileSchedule. The minimum update interval is 1 hour, however.
See here.
Related
So I want to know how a quickreply toast can be sent to the right person and when you click on it, it goes to the specific person.
Example 1:
Person A texts me, I pull down on the interactive notification and type my response and it gets processed by the background process. How does the applications know that my response goes to Person A. is there an attribute in the XML of the toast that can be a variable, like the phone number?
Example 2:
Person A posts a picture on my facebook, I click on the notification and it takes me to the page on facebook. Again is there an XML variable with a URL of it or something?
You can download this Microsoft Windows UWP sample, where you can see what code they use to manage notifications.
I think that you need Toast notifications:
Toast notifications are small pop ups that appear on the screen for few seconds. They convey messages and can be customized to even play different sounds. New to Windows 10 are actionable toasts where a user has a choice to interact with the notifications by use of a button, for example.
I am working on windows development & I am displaying the items on the emulator by using a web service.
Now I want to send a toast notification when an item added to the service. Already I worked with push notifications. But It’s generating push channel URL when app is initialized.
I don’t want to use this channel URL. So I tried Background Agent & Shell Toast to send the notification. Its working fine for static data. How can I add dynamic data to back ground agent which is coming from web service?
One more thing is, there are two things like PeriodicTask & ResourceIntensiveTask. How can I use this to send a toast notification by using Background Agent?
You can refer to this Tutorial From Nokia
http://developer.nokia.com/community/wiki/How_to_create_simple_Background_Agent_in_Windows_Phone
and this from CodeProject
http://www.codeproject.com/Articles/656654/Windows-Phone-Background-Agent-Part-Periodic-T
I am developing an app in windows phone where I enter the score of the match and the other windows phone users who has the same app should get that score as a toast notification(if any other better way suggest me).
I also want to push the data to this app users from a rss feed. This feed gets refreshed data for every 1 or 2 mins.
IS this possible to implement this in windows phone ?
If you only want to send the notification of the match score to certain users then you could use Push Notifications.
If everyone needs to get the notification then you would just use a BackgroundAgent. The Background agent will run approximately every 30 minutes (if you need it to be more accurate then you're back to Push Notifications). When the agent runs you could just check to see if there are any new match scores since the time the agent last ran and then pop the toast if there are.
You should also use the Background Agent for checking your RSS feed.
I'm testing out Windows Phone 7.5 push notifications. I have got the 3 different push types working fine (Toast, Tile and Raw) and am able to send messages from unit tests and a web application without any problems and receive them in my WP application. I want the ability to add extra properties to the push notification and the Raw push type does this perfectly for me and I can add custom key/value pairs or anything else to the push message and extract it on the phone app. I have just found out however that it only works if the application is running and my unit tests fail (suppressed notification status is received in unit test) when the phone application is not running (checked documentation which confirms this too). Is there anyway to add extra properties (key/values) to toast or tile messages or some way I can use raw in another way ? Toast notifications seem limited to a title property and an actual message property but I need to add additional data.
Just wondering if anyone had any suggestions / workarounds ?
The general practice I use is to initially send a raw notification to the device with phone-usable data embedded in the message. If my application is currently running then I can process the contents of the raw message and immediately make use of it on the phone. However if the application is not currently running on the phone you will receive notification from the push servers that the message could not be delievered. If I receive this response I send out a Toast / Tile notification.
With Toast notifications the only parametrisation you have access to is the URI that will launch the application. This is specified with the wp:param node of the message. Eg.
<wp:Notification xmlns:wp="WPNotification">
<wp:Toast>
<wp:Text1>Toast Title</wp:Text1>
<wp:Text2>Toast sub title</wp:Text2>
<wp:Param>/MainPage.xaml?LaunchedFrom=A%20Toast%20Notification</wp:Param>
</wp:Toast>
</wp:Notification>
If the user taps on this toast notification your application will launch and navigate to MainPage.xaml. You can access the querystring passed in via the NavigationContext.QueryString.
Note: The wp:Param node can only be sent to Mango (and up) devices. Additionally the entire contents must be less than 256 characters or you'll receive a PushErrorTypeMessageBadContent error. (Thanks to Ritch Melton for pointing this out). More info available from the Sending Push Notifications for Windows Phone page on MSDN.
As you've discovered, the Microsoft Push Notification Service is very strict in what types of messages you can send and receive. The intent of these push notifications is to provide simple push updates and not large amounts of data. The flexible Raw type seems like it would fit the bill until you discover that:
You can use a raw notification to send information to your application. If your application is not currently running, the raw notification is discarded on the Microsoft Push Notification Service and is not delivered to the device.
However, if you send a toast notification to your application, when the user clicks on the toast the application is started. When your application starts, you should check a service and retrieve the data you are trying to send from a web-service or other remote mechanism.
I tried the following tutorials to create the push notification in Windows Phone 7.
http://www.sgtconker.com/2010/03/article-windows-phone-7-push-notifications/
http://www.silverlightshow.net/items/Implementing-Push-Notifications-in-Windows-Phone-7.aspx
I can create the channel uri in the WP7 emulator without any error.
However, when I post the push notification from the server to the channel uri. I could only receive the 404 error.
Could anyone give me some help ?
Thanks.
=====
Update 1 (28-Oct):
Thank you very much for the answers.
After I read the latest resources and sample codes, I just sent a push notification to the WP7 emulator successfully.
The channel setup part in WP7 does not change much in the latest SDK.
The problem that I encountered before was from the POST message part of the sender.
The following website is quite useful.
http://www.thisisfanzoo.com/Blog/JeffF/archive/2010/08/02/a-really-long-post-about-the-windows-phone-7-push.aspx
He shows how to correcty build the POST message and it is very critical.
Also the channel uri that created before will expire, when the WP7 emulator (handset) turns off over an hour. Hence, we need to keep track of the channel uri and update the server once it changes.
Have a nice day.
=====
Update 2 (28-Oct):
I just created the POST message using cURL in Linux server, and successfully delivered it to the WP7 emulator by push notification.
Text encoding like ASCII-UTF-8 conversion issue was fixed too.
There were some changes to notification handling through the ctp and beta as Matt advices.
I'd recommend checking out this documentation for an overview, detailed code samples and response codes.
Push Notifications for Windows Phone
How to: Set Up a Notification Channel for Windows Phone
How to: Send a Push Notification from a Web Service for Windows Phone
Also if you'd like to get some more overview I'd recommend checking out the Mix 10 and Tech Ed 2010 NA talks by Peter Torr. If you'd like points in the video to skip forward to I can get these.
The articles you refer to are very old and relate to the Beta and CTP versions of the tools. Unfortunately Push notifications is an area which saw much change before RTM/RTW.
Have a look at the up to date instructions on MSDN at http://msdn.microsoft.com/en-us/library/ff402537(v=VS.92).aspx. I suspect you'll have much better luck with instructions which match the current tools.