3

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"]];
    }
}

enter image description here

Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
m.v.n.kalyani
  • 760
  • 7
  • 20
  • Those are called **URL schemes** in iOS. Official Skype URIs documentation and examples can be found at https://msdn.microsoft.com/en-us/library/office/dn745885.aspx and the Skype URI API reference at https://msdn.microsoft.com/en-us/library/office/dn745882.aspx – Alejandro Iván Sep 11 '15 at 05:19

4 Answers4

5

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.

Maishi Wadhwani
  • 1,104
  • 15
  • 24
4

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.

Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165
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

Community
  • 1
  • 1
Ben
  • 3,832
  • 1
  • 29
  • 30
0

Using Swift 5 you can integrate "one to one" call and also one to many call in skype

@IBAction func btnStartSkypeCall(_ sender: UIButton) {
        var installed: Bool? = nil
        if let url = URL(string: "skype:") {
            installed = UIApplication.shared.canOpenURL(url)
        }
        if installed ?? false {
            if self.mainModelView.eventList!.students?.count ?? 0 <= 1{
                if let url = URL(string: "skype:SkypeID?call&video=true") {
                    UIApplication.shared.open(url, options: [:], completionHandler: nil)
                }
            }else if self.mainModelView.eventList!.students?.count ?? 0 > 1{
                if let url = URL(string: "skype:test_skype;test2_skype;test3_skype?call&video=true") {
                    UIApplication.shared.open(url, options: [:], completionHandler: nil)
                }
            }else{
                print("Student list is empty")
            }
            
        } else {
            if let url = URL(string: "https://itunes.apple.com/in/app/skype/id304878510?mt=8") {                 
                UIApplication.shared.open(URL(string:"\(url)")!)
            }
        }

    }

To start a chat use the schema

skype:user?chat

To start a video call use

skype:user?call&video=true

You must be add in plist file

    <key>LSApplicationQueriesSchemes</key>
    <array>
    <string>skype</string>
    </array>
pansora abhay
  • 892
  • 10
  • 16