App launched due to push notification tap - c#

Hello I am working on a windows phone 8.1 (RT) application and I am receiving push notifications on the app. What I want to do is, check if the user tapped on the push notification to launch the app. Because in my case suppose the push notification says "new story about Batman", now when the user taps on the push notification I need my app to navigate to the storyPage.xaml and update the view about the new story about Batman. I tried to search online but I couldn't find anything useful and I know it's possible because we all use whatsapp. when we tap on the notification about the message, that particular chat opens. I found This Link but I don't know where to put this code. How can I achieve this? I need help Thanks.

While sending push notification, you toast xml should have launch parameters.
When the user taps or clicks the notification, the associated app is automatically launched, and so its OnLaunched method is invoked. If we want to determine whether the app is activated by a toast notification click, we can use the Arguments property of the LaunchActivatedEventArgs object that is passed to this method.
Please have a look on this blog: https://marcominerva.wordpress.com/2013/03/25/how-to-pass-arguments-to-an-app-activated-by-a-toast-notification/

Related

Action Center Toast Notification without Shortcut

I've created a custom C#/WPF application that can send toast notifications that has an activator that can handle activation. I'm using WiX to deploy the solution and create a shortcut with ShortcutProperty elements for System.AppUserModel.ID and System.AppUserModel.ToastActivatorCLSID.
Everything works perfectly as expected but I wonder one thing. Is it possible to register the ToastActivator without creating a shortcut? This program is going to be used on an internal enterprise network and I don't intend for it to have any UI. It'll be launched by the Task Scheduler, check a web service and send toast messages to the user when they apply.
If I must have a shortcut, the best UX I can think of is to just diplay an about dialog and exit.
Based on the Application Model Microsoft has, any UWP feature like notification center, toasts etc can only be done by a registered application.
An application is "registered" when its added to the start menu with a link.
There has to be a valid shortcut with a System.AppUserModel.Id otherwise all the new win10 features do not work.
https://learn.microsoft.com/en-us/windows/win32/shell/quickstart-sending-desktop-toast

How to get my notification to contionuosly alert my user windows 8.1 device or c#

I have successfully been able to send and receive notifications between my windows 8.1 application and my server using WNS. The only problem is when my toast notification comes through to my device it shows for about 10 seconds then disappears. This is no good for me as if my user was not with their device they would miss the notification completely. So what I want to know is where I fix this problem?
1.Is there a setting in the device that I can change to have the notification continue for more than 10 seconds. Or to make sure the notification keeps working till the user has touched the notification or device.
2. Or do I need to specify in the server that the same notification needs to be sent every say 10 minutes till the user has client app side has acknowledged that the notification has been seen?
What is the best way to do this?
Stuart's answer is correct. A Toast notification is not meant to be continuously visible, but a Live Tile notification can be. I think you would be best off by throwing a toast notification to immediately notify the customer and then have a live tile that shows the information as well.
Throwing a notification every 10 minutes is incredibly annoying. I would delete your app in a heartbeat if you did that to my phone/machine.

How to handle WNS push notifications in Windows Phone 8.1 -silverlight

I implemented WNS push notification in my Windows Phone application. And the application are getting the toast notifications successfully.[Sometimes with a delay].
Now toast notification functionality will work only when the user tap it when the application is not open. In any case the user swipe out the notifications form the action center,so the user could not see the missed notifications.
Is there any way or api to get/store those entire toast notification
list in Windows phone ?
I know ToastNotificationHistory class, But where I could see only clear or remove notifications.Please provide me clarification on it is possible or not ?
Also when the device is on low power state, no toast notifications are coming on the device. So the user misses that too. How to handle this case too ?
Please provide me a detailed clarifications on my work around.
related SO question is here
Thanking you all.
Hi asitis, I would like you to know that ToastNotificationFactory's
Clear and Remove methods only apply to those notifications that are
generated by the app itself(local notifications). These methods can not do
what they are saying to those notifications that are coming from WNS
service.
Also You don't have much control over the WNS notifications when
application is closed. They are all handled by user. Like if they
have deleted them or read then they are not available anymore.
May your functionality will be fulfilled by your own server that does
this saving/retrieving notification things. over an endpoint to your
client app. Then you may use Background agents to fetch these
notifications without the user interaction and send the internal
notification to the user from background agent itself.
But background agents are not the good things because they eat the
battery and user can intentionally disable them for all apps. so your
implementation will not be of any use.
So IMO please review your requirement and try to figure out what exactly you need. Also read guidelines of pushnotifications usage I think this => Push Notification Guidelines will definitely help.
Notification Disabling :- for this don't use any client side logic/code because in this case you have to re-publish the client(app) every time your logic changes. So put this logic from where(server) you are sending the notifications. like :- filtering if users..
you can change this filter logic according to your needs in future.
Hope it help you :)

Show pending push notification count in Windows Phone

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
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.

Getting the number of push notifications received?

I've been learning about the push notifications on Windows Phone 7, and I was searching for a way to know how many Toast notifications a certain app got.
For example: Between 5 PM and 7 PM, my app would receive 7 Toast notifications when the user opens the app. It would display somewhere that it got those 7 notifications (and if possible the time and content of them).
Is this possible, and if so, how?
I've searched for some tutorials on this but all I find is the send and receive tutorials.
If wp7 receive toast notification and user doesnt tap on it, toast notification just disappear.
So answer on your question is : NOT POSSIBLE.
Idea: you can create something like "confirmation request". When user tap on notification, you can send info to server. When user doesnt tap on notification I recommend use TILE notification...you can display number of unconfirmed notifications...and when user run app you can download all unconfirmed notifications's data.

Categories

Resources