How can I launch the Alarms App through a Universal Windows App

落花浮王杯 提交于 2019-12-11 02:24:30

问题


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.



来源:https://stackoverflow.com/questions/37953829/how-can-i-launch-the-alarms-app-through-a-universal-windows-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!