2014年2月4日 星期二

[Windows Store] 在Windows Store App中去開啟Skype

今天無意間在網路上看到Skype的URI API介紹,其中也有支援可以在Windows Store App中去呼叫開啟Skype,而且使用方式很容易,下面就用個簡單範例來示範

private async void Button_Click(object sender, RoutedEventArgs e)
{
//直接開啟Skype
await Launcher.LaunchUriAsync(new Uri("skype:"));
//開啟Skype並撥打給user1
//await Launcher.LaunchUriAsync(new Uri("skype:user1?call"));
//開啟Skype並與user1聊天
//await Launcher.LaunchUriAsync(new Uri("skype:user1?chat"));
}
view raw LaunchSkype.cs hosted with ❤ by GitHub

主要就是透過URI的參數來決定執行後的動作,更多的參數說明可以參考Reference的連結,另外如果是使用javascript開發的話,直接參考官網上的Tutorial就可以了。

Reference

Skype URI API Reference
Skype URI Tutorial: Windows 8 Apps

0 意見:

張貼留言