I am trying to receive a push notification in Windows Phone Silver light 8.1 app, I have learn through This Example. It's work fine when app is running but when I close the app at that time, it is not receiving a notification, or might be not able to display a toast notification.
When app is running at that time notification displayed in a Message Box, so the problem I face is toast notification. Is there any hidden code for Toast Notification?
It was working fine earlier but after some time it automatically stopped displaying toast notification.
Please Help me resolve this problem.
ShellToast toast = new ShellToast();
toast.Title = "[title]";
toast.Content = "[content]";
toast.Show();
Check this site: http://msdn.microsoft.com/en-us/library/windows/apps/jj662938(v=vs.105).aspx
Also you have to make sure your app is allowed to run in background, and make sure that it can run in background.
Related
I have question about push notifications in Windows phone 8.
As i understand, there are three types of push notification:
Toast Notification.
Tile Notification.
Raw Notification.
So, in my opinion:
if the app is running, and opened in foreground:
Toast will be not shown, but i can handle it`s event and do something.
Tile will be updated automaticaly
Raw Notification must be handled by me. (Question one: can i do it without background task?)
if the app is running now, but suspended:
Toast will be shown as it came, without any event handling in my app, only "BindToToast()"
Tile Will be updated, without any event handling, only "BindToTile()"
Raw notification must be handled by background Task.
if the app is not open:
Toast will be shown automaticaly, if in previous launch "BindToToast()" was called.
Tile will update automaticaly, if in previous launch "BindToTile()" was called,
Question 2: what about raw notification? how to handle it here?
I think the situation is as follows:
Toast notification is shown only when the app is not running, but can be intercepted when it is
Tile notification always updates the tile regardless of application running
Raw notification can only be processed by the application when running.
Toast/raw notifications cannot normally be handled by a background task in Windows Phone 8.0. But there maybe a hack to get around this. See Windows Phone 8 notifications and background tasks and Windows Phone 8 Background Task with notifications
In Windows phone 8.1 it is quite possible to create a background task that is invoked when a notification is received, so the notification can be processed by the background task.
We're developing an application which is receive toast notification when app is not active.
But it's seem like Mvvmcross Core have taken control of the application and control the RootFrame. So when a toast notifcation comming, user click in that toast and the application doesn't launch exactly to the uri was set in the push, it launched to page that was set in Core when App Start.
I would ask if there's anything solution for this case ?
Thank you very much :)
This scenario is covered by "Custom app starts" - it's covered for WP in https://speakerdeck.com/cirrious/appstart-in-mvvmcross - there's also some information about custom AppStart in the wiki on http://github.com/mvvmcross/mvvmcross/wiki
I am trying to intercept a toast notification from a facebook app to make my own customized app but I cant seem to find any information on how to intercept a toast notification from a 3rd party app from my own app.
Is it possible to intercept a toast notification from some other app in my app on windows phone?
No, it's not possible. It looks like a scam for me. Use your own notifications from facebook.
I am developing a chat application...
For getting toast notifications i am sending notification uri to Microsoft server...
When i close app if i am getting toast notifications,i click on toast then it is redirecting to particular page that i specified..
But when i deactivating from the app and if i got any toast notification and i click on it then it is not redirecting to that chat page but redirecting to the page that i deactivating from the app.
I hope you understand the scenario..
How to redirect to that page when i deactivated the app also?
Since you're using Fast App Resume you'll want to read through http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj735579(v=vs.105).aspx and even play with the sample code right at the end of that article.
You should be getting a Navigated event which you can handle to refresh your content / redirect to the right place. If it isn't working for you and you aren't cancelling any in-progress navigations during app resume then there may be an edge case bug that you're hitting.
I made a little app for WP8 that would fetch notifications from Azure mobile service table (and it did). Then I added push to it. The app is identical to the sample app given on the Azure website. I even tried the sample one and the same thing happened: log shows toasts have been sent but my device doesn't receive any at all.
Also, I have done the same with WinJS app and it works flawlessly.
Last night, I tried it again and got toast on device just once out of nearly 20 requests.
I am clueless - if its the code that you are looking for it's right here http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-push-wp8/
Any help would be appreciated, thanks!
Were you running the application in the foreground on the phone at the time? Toasts don't show on WP8 if the app is in the foreground.