How can I launch the Alarms App through a Universa

2019-07-12 23:08发布

问题:

I am trying to launch the default Alarms App somewhere in my app through an action the user performs. I know you can now add your own alarms and notifications but I want the user to be able to use the default Alarms App.

How would I go about doing this?

回答1:

You can use Launcher class to launch the Alarms App by uri as follows:

await Windows.System.Launcher.LaunchUriAsync(new Uri(@"ms-clock:"));

The uri of Alarms&CLock is ms-clock in system. You can find the protocol in Settings->System->Default Apps->Choose default app by protocol in a PC device. Pay attention the Alarm&Clock app should be existed in the device. More details you can reference:Launch the default app for a URI



回答2:

With the Universal Application Model it is not possible to launch other apps at random. You can only launch an app if it enables deep-linking.

Here is a great article about deep-linking and app to app communication in general.

For your particular question, @Sunteen provided a great answer as to how to open the alarms app but more importantly, how you can find which apps you can open and what their protocol extension is.