How can I launch the Alarms App through a Universa

2019-07-12 22:21发布

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?

2条回答
劫难
2楼-- · 2019-07-12 23:15

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

查看更多
ゆ 、 Hurt°
3楼-- · 2019-07-12 23:24

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.

查看更多
登录 后发表回答