【发布时间】:2014-06-26 09:46:36
【问题描述】:
我想在我的 iOS 应用上实现 Skype 即时消息发送/共享。我只是想在 Skype 上分享某个链接。
以下是正在使用的代码:
//skype sharing
BOOL installed = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"skype:"]];
NSString * msg = [NSString stringWithFormat:@"Hi. Check it out.\n %@ %@",[[self Detail] objectForKey:@"title"],self.shareLink];
NSString * urlSkype = [NSString stringWithFormat:@"skype:?chat=%@",msg];
NSURL * SkypeURL = [NSURL URLWithString:[urlSkype stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
if(installed)
{
[[UIApplication sharedApplication] openURL:SkypeURL];
}
else
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.com/apps/skype/skype"]];
}
如果安装了Skype,那么上面的代码也不能正常工作。我希望消息-msg 应该自动发送(作为即时消息)给我从 iOS 应用程序中选择的 Skype 联系人。
我该如何实现?
【问题讨论】: