How to achieve AlarmApplicationManager AlarmAccessStatus as AllowedWithWakeupCapability? - c#

The AlarmApplicationManager provides a method RequestAccessAsync() to request permission from the user to be set as an alarm app. This seems to generate a dialog with Yes and No buttons. If the user taps on No, the value returned is Denied and when user taps Yes , the value seems to be AllowedWithoutWakeupCapability. But this link explains that it can return 4 values including AllowedWithWakeupCapability. How can I achieve AllowedWithWakeupCapability so that the device can wake up from sleep mode when alarm time is reached?

Related

How to increase the show time of toastNotification in uwp?

I am creating application using scheduled Toast Notification. I want to increase the show time of the Notification. How can i set the time for display the notification. Is there any other option for this?
According to the documentation you can use the duration property of your Toast Notification XML to display it either for a short (7s) or long (25s) time:
<toast duration="long">
<visual ... />
</toast>
This attribute was introduced back in Windows 8 time-frame for specifying how long the toast notification stays on the screen – setting the value to “short” will make the notification display for  ~7 seconds and setting it to “long” will make the notification display for ~25 seconds.
In Windows 10, developers have the following options to keep the notification on screen for longer than standard length (~7 seconds):
Specifying scenario attribute (see description below) to “alarm” or “reminder” to persist the notification on screen until the user dismisses it. 
Specify duration attribute to “long” while making sure the scenario attribute is specified to “default” or unspecified. This will result in the legacy behavior of notification showing on screen for ~25 seconds. 
We do not recommend using this property unless you have a good reason to keep the notification up for ~25 seconds on screen. This attribute exists mainly for appCompat reason. 
Further you can create a reminder notification to keep it visible until the user interacts with:
<toast scenario="reminder">
<visual ... />
</toast>
Note as stated in the documentation:
Do not use this just for keeping your notification persistent on screen.

Remove UIAlerts When App Goes to Background

In my app I give a alert, if the user wants to confirm the offer or not.
Now I noticed that if the user hits the home button, the alert stays there & makes my app crash if he would enter anything.
How can I remove the alert (all UIAlerts) when I go to background mode?
Kind regards,
Glenn.
Edit 1:
Basically I a making a offer page. When the user clicks OK, I am showing a UIAlert for extra confirmation.
Now I also have functionality that when a user closes (home button) the app & restarts it, it will go to the overview page (where all the products are) and will ask the server for the data (makes the data up -to-date again.).
Normally there would be no problem with my app going into background mode. But with the functionality of refreshing the data & going to another controller it probaly gives problems. Therefore I need to be able to close all the UIAlerts still active.
You app crashes not because of UIAlerts but because something is going wrong. Even if you put an app in the background while showing a UIAlert, the alert stays there.
- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated;
you can use it with this method in AppDelegate.m:
- (void)applicationDidEnterBackground:(UIApplication *)application
but Nikos M. was right: you should find and fix the source of this problem, but not to disguise it. there is a simplest way to show alert, check it, may be it'll help:
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:#"Title" message:#"Some message" delegate:nil cancelButtonTitle:#"Ok" otherButtonTitles:nil];
[alertView show];

How to get result from LaunchUriAsync(Uri)

I'm use the following function to prompt the user to rate my app:
Launcher.LauLauncher.LaunchUriAsync(
new Uri("ms-windows-store:reviewapp?appid=" + APP_ID))
I want to check if user click on the "Cancel" button in page rating.
How can I check if the user clicks on the "Cancel" button?
Basically you're asking whether it's possible to determine whether the user actually left a rating/review when you invoke the Store URI. Unfortunately, this isn't possible at present, but it is a frequently requested capability.

Disable next/prev buttons in Universal Volume Control (uvc) when using AudioPlayerAgent

I'm currently working on an radio app for WP7 Mango and I want to disable the next and the previous track buttons in the UVC like last.fm did in their app, but I can't figure out how.
Can someone help me with this?
You can select which controls are active in the UVC when you create the track to play in your agent (i.e. from the code which handles the TrackEnded event in the Background Audio Agent).
For example:
EnabledPlayerControls controls = EnabledPlayerControls.Pause |
EnabledPlayerControls.Rewind |
EnabledPlayerControls.FastForward;
AudioTrack track = new AudioTrack(
trackUri,
trackTitle,
trackBy,
trackAlbum,
trackAlbumArtUri,
trackTag,
controls);
...
return track
This will allow you to be able to make the agent skip tracks when your application wants, but Skip won't work by tapping the buttons on the UVC.
(In this example if the user taps and holds the fast-forward and rewind buttons in the UVC, the track will still fast-forward/rewind).
If you don't supply a entire playlist, but only a single MediaHistory , the Previous/Next buttons should be automatically disabled.
The same should apply to the AudioStreamingAgent. If you wish to disable the ability to use the buttons, handle the BackgroundAudioPlayer.Instance.PlayStateChanged event, see WP7 Mango: How to handle skip next/previous from UVC outside of the Audio Playback Agent class library? for details.
Post some code, if you want more detailed help.

creating popup message

I want to show a popup window for few seconds to greet users on their desktop.
it should be non-interactive.i want to do this in c# ,winform or wpf.
For example,
After user logged in, For every 3 hours , “Hello” message Should be shown for a second, then auto hide.
can anyone give some ideas.
thanks
In WPF:
Use Popup control to display your "Hello".
In the application, to set up recurring popup display and close, set up an instance of System.Windows.Threading.DispatcherTimer Class.
Create a form to display whatever message you want, size it however you feel. But a timer on it for 3 seconds that will do form.close() when the timer expires.
when your app loads, have it display the form.

Categories

Resources