I am developing a Windows Phone 8 application, and I've implemented a background agent which does some work and also updates my application's Tile and shows a toast notification to the user.
It works, except when I am launching the application (more specifically when control is in the Application_Launching event) in which case the Toast notification is not shown, but the Tile still gets updated. Has anyone ran into this before?
A toast will not be displayed if the current foreground application is the caller of the Show method. Toast notification only display in the running background agent or some of the work are finish.
Related
I wrote a Windows Phone 8.1 (WINPRT) App. One of the features of this app is alarm/reminder.
For Example: user sets the Reminder at 7AM in app's Reminder Page. App must give alarm/reminder daily at 7AM. Now as I got to know, that alarm and reminder are not available in Windows Phone 8.1, so I thought of using Toast.
How will this app give a toast at user set time everyday.?
Also, how to make this app run in background for this purpose.
Any other better solution for this problem?
If your app is running a background process, it will be invoked every 30 minutes or so. You won't be able to get it to send out a toast notification exactly at 7am as far as I know, but you can get it within 15 minutes or so of 7am.
You can also schedule a toast notification to occur. Details here.
Have you looked into this?
https://msdn.microsoft.com/en-us/library/windows/apps/hh202965%28v=vs.105%29.aspx?f=255&MSPPError=-2147217396
I think this might answer your question
I'm working on Toast Notifications for my WP8.1 Silverlight App that are activated via a background process. Whenever I tap on the Toast when it appears (or tap on it from the Notification Action Center), it always restarts the app. It navigates to the main page for a split-second and I notice that the Bing Map I have embedded in the Mainpage is blank, then it restarts. I specify in the toast for it to go to the mainpage as follows (with a parameter):
((XmlElement)toastNode).SetAttribute("launch", "#/MainPage.xaml?conversation=12345");
Other aberrant behavior is
When debugging, and the app is invoked from the Toast the main page 'onNavigatedTo' event gets hit twice both times with the parameter specified from the toast.
When the app relaunches itself after being invoked from the Toast, and I go back to the Start Screen and tap the Live Tile to be taken back to the app, it again needs to restart itself. This never happens if I launch the app normally from the Live Tile or Application Icon.
The debugger isn't catching anything. Could it be something to do with the app being tombstoned, or the app 'Applicated_Activated' event not being hit up properly?
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.
I have app with dispatcher timer. User set some interval(for example 30 sec) and press button start. App Each 30 sec play sound. All work ok. But when User lock phone timer stopped and nothing played. Can I play sound each 30 sec when phone is locked?
It is possible to keep the app running under lock screen.
Using Idle Detection, you can keep the app on, although screen is locked. Actually, it is not running in background, but in the foreground. Just the screen is locked. So, be careful not to drain user's battery.
You have to set the PhoneApplicationService.ApplicationIdleDetectionMode property to Disabled, for example in InitializePhoneApplication() method in App.xaml.cs:
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
Note that there are special certification requirements for this type of apps. Refer to section 6.3 (Apps running under a locked screen) of the following page:
Additional requirements for specific app types for Windows Phone
yes.
sure..
You can use the Scheduled Task Agent in windows phone.
using the Scheduled Task Agent, when you app is not running or stopped (not in background).
you can fire your Events.
For that you have to add the scheduled task agent into your project.
And in the ScheduledAgent.cs file find the OnInvoke method and put your code here.
this method performs the task in Background. (Means the code is executed when your phone is locked).
for more Reference click here Implement background agents for Windows Phone
I hope you get the destination. Now, just put that code into your application and its working.
When Reminder created with set path in NavigationUri param have such issue:
when phone is blocked (under locked screen) and reminder shown, it's impossible to navigate to the app using Tap on title or content of the reminder message.
Is it possible to solve such problem, or it's ussual behaviour for reminder and lock screen?
It's the normal behavior for Windows Phone 7, the user needs to unlock the phone to interact with notifications. There's nothing you can do about it.
There's a few obvious reasons for this behavior. Imagine that the user has put a pin-code on the lockscreen. Someone picking up the phone would be able to bypass the pin-code by tapping on a notification. Or even if there's no code, I may trigger something involuntarily if the phone is inside my pocket when a notification is displayed.