问题
I am new to iOS. I want to integrate Skype in my iPhone application,for this I have searched lot but I have not found a solution for this
How can I get Skype SDK for integration. How can I integrate Skype API in my application. Is there any other way to make developer Skype account
If your people having any sample code please post that.Please help me. Many Thanks.
I have tried some code please see that below but using that code my simulator it's showing alert like below image
my code:-
- (IBAction)skypeMe:(id)sender {
BOOL installed = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"skype:"]];
if(installed)
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"skype:echo123?call"]];
}
else
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.com/apps/skype/skype"]];
}
}
回答1:
Here is your swift code:
Swift
@IBAction func skypeMe(sender: AnyObject) {
let installed = UIApplication.sharedApplication().canOpenURL(NSURL(string: "skype:")!)
if installed {
UIApplication.sharedApplication().openURL(NSURL(string: "skype:echo123?call")!)
} else {
UIApplication.sharedApplication().openURL(NSURL(string: "https://itunes.apple.com/in/app/skype/id304878510?mt=8")!)
}
}
Objective-C
- (IBAction)skypeMe:(id)sender {
BOOL installed = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"skype:"]];
if(installed){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"skype:echo123?call"]];
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://itunes.apple.com/in/app/skype/id304878510?mt=8"]];
}
}
I have changed skype URL for iTunes in this code and tested it with device and both URL is working fine.
回答2:
For Swift 3.0 It opens itunes url if it is not installed, otherwise it will open skype.
@IBAction func btnSkypeLinkPressed(_ sender : UIButton) {
let installed = UIApplication.shared.canOpenURL(NSURL(string: "skype:")! as URL)
if installed {
UIApplication.shared.openURL(NSURL(string: "skype:skypeID")! as URL)
} else {
UIApplication.shared.openURL(NSURL(string: "https://itunes.apple.com/in/app/skype/id304878510?mt=8")! as URL)
}
}
and in plist add:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>skype</string>
</array>
Hope it will work for swift users Thanks.
回答3:
in addition to @Dharmesh's answer, in iOS9 you must add the application you want to query for 'canOpenUrl' to you plist, under LSApplicationQueriesSchemes key
see this answer: https://stackoverflow.com/a/30988328/1787109
来源:https://stackoverflow.com/questions/32515430/how-to-integrate-skype-in-my-iphone-application