My WP8.1 App creates toast notifications that will appear - like SMSs - in the Notification center of the Windows Phone (this part works like a charm).
In one precise scenario, I would like to limit the number of notifications my app can have in the Notification Center at a given time:
"if a user has 3 notifications displayed, he cannot add another until he clears one of them".
Any idea how to hook into the notification center to know its state?
Thanks!
Related
Toast notification in Windows 10 is behaving strange. It does not stay in the action center even if user has not taken any actions yet. This behavior is with custom notification and generic both. Toast notification is generated using a Windows desktop application not using a universal window.
As answered here :
Win32 apps need to set up a COM server in order to have toasts persisted in Action Center: http://blogs.msdn.com/b/tiles_and_toasts/archive/2015/10/15/quickstart-handling-toast-activations-from-win32-apps-in-windows-10.aspx
You can go on https://github.com/WindowsNotifications/desktop-toasts to view some working samples in C++ and C#.
I am working on a Windows Phone 8.1 application which has to update tiles based on certain conditions like WiFi available, content exists in the knownfolders, etc...
During each Background task cycle i do something like this,
EnableNotificationQueue();
ClearTile();
CheckWiFi();//posts a notification saying Wifi is Present or not
CheckKnownFolderesContent();//posts a notifications with file count
This essentially creates a Notification queue of upto 5 tile notifications and clears the previous tile and post a tile notification accordingly.
What i am trying to understand is if it is possible to just update a tile notification which is already in the queue. For example: One background task create two notifications 1. No Wifi 2. 5 files in the folder.
Is it possible to just update the 2nd tile with new count by not clearing the other tile which already exists?
Found the answer. This can be done using tags.
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh868234(v=win.10)
Can I use All notification in single Windows Phone App (Tile , Toast and raw )? If yes then how ? Is there any example or link which uses all these three notification?
I have checked these links
http://msdn.microsoft.com/library/windows/apps/hh202967(v=vs.105).aspx
http://msdn.microsoft.com/library/windows/apps/hh202977(v=vs.105).aspx
and also what is different between Toast and raw notification.?
Thank You
Yes, you definitely can use all three types of push notifications. Why not? You just need to union the needed code from toast, tile and raw notifications articles. The code is pretty much the same except a few strings. You can merge it in one and you will get the app that uses all 3 types.
The difference between Toast and Raw is that when app receives Toast message - it shows a 'toast' (Top-aligned popup with app icon and some text above the accent color). As for wp8 - toast only shows itself when app is not active (not pretty sure about wp8.1). You can also check whether toast came to your app from code and do some more actions. As for Raw message - you just can subscribe to receive it and make some actions manually in your code - show MessageBox, refresh some data and whatever. So it seems to me that Toast notification is improved version of Raw notification.
I need to port an Android app which has a widget to WP8.
In Android the widget shows a countdown which is updated in the background automatically - even when the user has quit the app.The countdown starts at a certain pre-programmed time and just counts down - all donw without the user having to start the app in Android.
Is there some kind of similar functionality on WP8 with the tiles?
The app does not interact with internet and does not receive any external messages like email that can cuase the countdown to work. It needs to all happen automatically.
This is not possible in WP8 (or WP7).
At best you can update your app's tile on the homescreen once every half hour (best-case!). It sounds like you want to update more frequently than that.
As far as I know, Ios and Android gcm are able to open an application when a push notification event arrives.
For wp7, I only find samples on how to update tiles or display a message. But I need to display a bitmap in fullscreen.
Is there a way to open my app when I send a push notification ?
Thanks in advance for your help.
There is no way you can launch anything via a push notification on Windows Phone. Raw, toast and tile are the only acceptable types, none of which is able to invoke code execution outside the pre-defined boundaries (e.g. launch the app when the toast is tapped).
Since you are displaying an image, your best bet would be focusing on the tile updating mechanism. Remember, however, that there are no guarantees that the user will see the tile (unless pinned), or keep it on the home screen permanently.
If you send a Toast notification using the Notification mechanism, then tapping on the Toast will launch the application, you can then specify a page to navigate to within your application.
Take a look at the following for more information :
http://msdn.microsoft.com/en-us/library/hh202967(v=vs.92).aspx